Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BattleMuscle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
czy
BattleMuscle
Commits
73657235
Commit
73657235
authored
May 10, 2021
by
czy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
眩晕特效
parent
5df3f12e
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8080 additions
and
2425 deletions
+8080
-2425
StunnedCirclingStars.prefab
.../Prefabs/Combat/Brawling/Stun/StunnedCirclingStars.prefab
+7568
-2402
Running3.controller
...Assets/Art_Assets/Animation/Animation/Running3.controller
+114
-2
Level 1.unity
BattleMuscle/Assets/Levels/Level 1.unity
+321
-1
AIMove.cs
BattleMuscle/Assets/My/Scripts/AI/AIMove.cs
+27
-2
RandomFood.cs
BattleMuscle/Assets/My/Scripts/Food/RandomFood.cs
+26
-4
PlayerMove.cs
BattleMuscle/Assets/My/Scripts/Player/PlayerMove.cs
+24
-14
No files found.
BattleMuscle/Assets/Art_Assets/0D1_Effects/Epic Toon FX/Prefabs/Combat/Brawling/Stun/StunnedCirclingStars.prefab
View file @
73657235
This diff is collapsed.
Click to expand it.
BattleMuscle/Assets/Art_Assets/Animation/Animation/Running3.controller
View file @
73657235
...
...
@@ -46,12 +46,16 @@ AnimatorStateMachine:
-
serializedVersion
:
1
m_State
:
{
fileID
:
2643154680664092511
}
m_Position
:
{
x
:
270
,
y
:
-40
,
z
:
0
}
-
serializedVersion
:
1
m_State
:
{
fileID
:
-5151482140390748444
}
m_Position
:
{
x
:
740
,
y
:
-100
,
z
:
0
}
m_ChildStateMachines
:
[]
m_AnyStateTransitions
:
[]
m_AnyStateTransitions
:
-
{
fileID
:
7789786087314244433
}
m_EntryTransitions
:
[]
m_StateMachineTransitions
:
{}
m_StateMachineBehaviours
:
[]
m_AnyStatePosition
:
{
x
:
290
,
y
:
-24
0
,
z
:
0
}
m_AnyStatePosition
:
{
x
:
570
,
y
:
-20
0
,
z
:
0
}
m_EntryPosition
:
{
x
:
290
,
y
:
-150
,
z
:
0
}
m_ExitPosition
:
{
x
:
800
,
y
:
120
,
z
:
0
}
m_ParentStateMachinePosition
:
{
x
:
800
,
y
:
20
,
z
:
0
}
...
...
@@ -106,6 +110,33 @@ AnimatorStateTransition:
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
---
!u!1102
&-5151482140390748444
AnimatorState
:
serializedVersion
:
5
m_ObjectHideFlags
:
3
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Vertigo
m_Speed
:
1
m_CycleOffset
:
0
m_Transitions
:
-
{
fileID
:
8848785005566343156
}
m_StateMachineBehaviours
:
[]
m_Position
:
{
x
:
50
,
y
:
50
,
z
:
0
}
m_IKOnFeet
:
0
m_WriteDefaultValues
:
1
m_Mirror
:
0
m_SpeedParameterActive
:
0
m_MirrorParameterActive
:
0
m_CycleOffsetParameterActive
:
0
m_TimeParameterActive
:
0
m_Motion
:
{
fileID
:
7400000
,
guid
:
ee242bb4bb7f631408dbca2d01b22fd7
,
type
:
2
}
m_Tag
:
m_SpeedParameter
:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
---
!u!1109
&-2799690864505386981
AnimatorTransition
:
m_ObjectHideFlags
:
1
...
...
@@ -235,6 +266,12 @@ AnimatorController:
m_DefaultInt
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
0
}
-
m_Name
:
Vertigo
m_Type
:
4
m_DefaultFloat
:
0
m_DefaultInt
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
0
}
m_AnimatorLayers
:
-
serializedVersion
:
5
m_Name
:
Base Layer
...
...
@@ -337,6 +374,31 @@ AnimatorState:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
---
!u!1101
&1572285795481017674
AnimatorStateTransition
:
m_ObjectHideFlags
:
3
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_Conditions
:
-
m_ConditionMode
:
3
m_ConditionEvent
:
MoveSpeed
m_EventTreshold
:
0.2
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
8650196453075220448
}
m_Solo
:
0
m_Mute
:
0
m_IsExit
:
0
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_ExitTime
:
0.87288135
m_HasExitTime
:
0
m_HasFixedDuration
:
1
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
---
!u!1102
&2643154680664092511
AnimatorState
:
serializedVersion
:
5
...
...
@@ -527,6 +589,31 @@ AnimatorStateTransition:
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
---
!u!1101
&7789786087314244433
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_Conditions
:
-
m_ConditionMode
:
1
m_ConditionEvent
:
Vertigo
m_EventTreshold
:
0
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
-5151482140390748444
}
m_Solo
:
0
m_Mute
:
0
m_IsExit
:
0
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_ExitTime
:
0.75
m_HasExitTime
:
0
m_HasFixedDuration
:
1
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
---
!u!1101
&8583691091879068204
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
...
...
@@ -606,3 +693,28 @@ AnimatorStateTransition:
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
---
!u!1101
&8848785005566343156
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_Conditions
:
-
m_ConditionMode
:
2
m_ConditionEvent
:
Vertigo
m_EventTreshold
:
0
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
0
}
m_Solo
:
0
m_Mute
:
0
m_IsExit
:
1
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_ExitTime
:
0.87288135
m_HasExitTime
:
0
m_HasFixedDuration
:
1
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
BattleMuscle/Assets/Levels/Level 1.unity
View file @
73657235
This diff is collapsed.
Click to expand it.
BattleMuscle/Assets/My/Scripts/AI/AIMove.cs
View file @
73657235
...
...
@@ -33,6 +33,8 @@ public class AIMove : MonoBehaviour
public
GameObject
targetWall
;
//path pos0
public
GameObject
pathPos0
;
//眩晕特效
public
ParticleSystem
vertigoEffect
;
public
enum
AIState
{
...
...
@@ -42,6 +44,7 @@ public class AIMove : MonoBehaviour
TurnBackToPathPos0
=
3
//返回Pos0
}
public
AIState
aiState
;
private
float
vertigoTime
=
0.0f
;
// Start is called before the first frame update
void
Start
()
...
...
@@ -112,9 +115,15 @@ public class AIMove : MonoBehaviour
if
(
power
<
1
)
{
power
=
1
;
AddVertigo
(
1
);
}
Scale
(
power
,
power
,
power
);
}
//增加眩晕时长眩晕
public
void
AddVertigo
(
float
time
)
{
vertigoTime
+=
time
;
}
private
void
FixedUpdate
()
{
...
...
@@ -192,9 +201,25 @@ public class AIMove : MonoBehaviour
Vector3
speed
=(
targetObj
.
transform
.
position
-
transform
.
position
).
normalized
*
VSpeed
;
xDelta
=
speed
.
x
*
Time
.
deltaTime
;
zDelta
=
speed
.
z
*
Time
.
deltaTime
;
Move
();
if
(
vertigoTime
>
0
)
{
//眩晕
vertigoTime
-=
Time
.
deltaTime
;
vertigoEffect
.
gameObject
.
SetActive
(
true
);
animator
.
SetBool
(
"Vertigo"
,
true
);
animator
.
SetBool
(
"Push"
,
false
);
animator
.
SetBool
(
"Punch"
,
false
);
}
else
{
vertigoEffect
.
gameObject
.
SetActive
(
false
);
vertigoTime
=
0
;
animator
.
SetBool
(
"Vertigo"
,
false
);
Move
();
}
}
...
...
BattleMuscle/Assets/My/Scripts/Food/RandomFood.cs
View file @
73657235
...
...
@@ -4,22 +4,35 @@ using UnityEngine;
public
class
RandomFood
:
MonoBehaviour
{
public
int
foodNumber
=
10
;
[
Header
(
"生成食物个数"
)]
public
int
foodNumber
=
20
;
[
Header
(
"食物补齐时间间隔/秒"
)]
public
float
timeSpan
=
10
;
private
float
timer
=
0
;
public
List
<
Transform
>
foodPoint
;
public
List
<
GameObject
>
foods
;
void
Start
()
{
GenerateRandomFood
(
10
);
GenerateRandomFood
(
foodNumber
);
}
// Update is called once per frame
void
Update
()
{
timer
+=
Time
.
deltaTime
;
if
(
timer
>=
timeSpan
)
{
timer
=
0
;
//补全20个食物
complementFood
();
}
GameObject
[]
currFoods
=
GameObject
.
FindGameObjectsWithTag
(
"Food"
);
if
(
currFoods
.
Length
==
0
)
{
GenerateRandomFood
(
10
);
timer
=
0
;
GenerateRandomFood
(
foodNumber
);
}
}
...
...
@@ -44,5 +57,14 @@ public class RandomFood : MonoBehaviour
{
return
foods
[
Random
.
Range
(
0
,
foods
.
Count
)];
}
/// <summary>
/// 补全食物个数到foodNumber个。
/// </summary>
public
void
complementFood
()
{
GameObject
[]
currFoods
=
GameObject
.
FindGameObjectsWithTag
(
"Food"
);
int
addFood
=
foodNumber
-
currFoods
.
Length
;
//print("生成食物:"+ addFood);
GenerateRandomFood
(
addFood
);
}
}
BattleMuscle/Assets/My/Scripts/Player/PlayerMove.cs
View file @
73657235
...
...
@@ -33,8 +33,7 @@ public class PlayerMove : MonoBehaviour
private
float
yDelta
=
0
;
private
float
zDelta
=
0
;
//眩晕时长
private
float
timerVertigo
=
0.0f
;
//动画
private
Animator
animator
;
//状态
...
...
@@ -43,7 +42,10 @@ public class PlayerMove : MonoBehaviour
private
bool
Grounded
=
false
;
public
GameObject
targetWall
;
public
GameObject
children
;
//眩晕
public
float
vertigoTime
=
0.0f
;
public
ParticleSystem
vertigoEffect
;
// Start is called before the first frame update
void
Start
()
...
...
@@ -80,7 +82,7 @@ public class PlayerMove : MonoBehaviour
//Destroy(other.gameObject);
//print("吃到食物。");
power
+=
0.
3
f
;
power
+=
0.
1
f
;
Scale
(
power
,
power
,
power
);
Destroy
(
other
.
gameObject
);
}
...
...
@@ -93,7 +95,7 @@ public class PlayerMove : MonoBehaviour
if
(
power
>
1
)
{
hit
.
gameObject
.
GetComponent
<
Rigidbody
>().
AddForce
(
new
Vector3
(
0
,
0
,
100
));
power
-=
0.0
1
f
;
power
-=
0.0
23
f
;
}
else
{
...
...
@@ -109,9 +111,15 @@ public class PlayerMove : MonoBehaviour
if
(
power
<
1
)
{
power
=
1
;
AddVertigo
(
1
);
}
Scale
(
power
,
power
,
power
);
}
//增加眩晕时长眩晕
public
void
AddVertigo
(
float
time
)
{
vertigoTime
+=
time
;
}
private
void
Scale
(
float
x
,
float
y
,
float
z
)
{
...
...
@@ -240,20 +248,22 @@ public class PlayerMove : MonoBehaviour
if
(
!
BattleCtrl
.
instance
.
IsScoreSettlementStatus
)
{
//print("控制摇杆");
if
(
timerVertigo
<=
0
)
if
(
vertigoTime
>
0
)
{
timerVertigo
=
0
;
//移动控制。
UpdateJoystick
();
//眩晕
vertigoTime
-=
Time
.
deltaTime
;
vertigoEffect
.
gameObject
.
SetActive
(
true
);
animator
.
SetBool
(
"Vertigo"
,
true
);
animator
.
SetBool
(
"Push"
,
false
);
animator
.
SetBool
(
"Punch"
,
false
);
}
else
{
//眩晕
timerVertigo
-=
Time
.
deltaTime
;
xDelta
=
0
;
//避免眩晕期间不会执行UpdateJoystick();造成偏移现象。
vertigoEffect
.
gameObject
.
SetActive
(
false
);
vertigoTime
=
0
;
animator
.
SetBool
(
"Vertigo"
,
false
);
UpdateJoystick
();
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment