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
b24f623e
Commit
b24f623e
authored
May 14, 2021
by
czy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boss动画优化
parent
3c1a7b98
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
931 additions
and
63 deletions
+931
-63
Running2.controller
..._Assets/Animation/AnimationController/Running2.controller
+91
-24
Level 1.unity
BattleMuscle/Assets/Levels/Level 1.unity
+671
-16
HurricaneKickBefor.anim
BattleMuscle/Assets/My/HurricaneKickBefor.anim
+60
-0
HurricaneKickBefor.anim.meta
BattleMuscle/Assets/My/HurricaneKickBefor.anim.meta
+8
-0
HurricaneKickTrigger.prefab
BattleMuscle/Assets/My/Model/HurricaneKickTrigger.prefab
+1
-1
LegSweepTrigger.prefab
BattleMuscle/Assets/My/Model/LegSweepTrigger.prefab
+1
-1
BossAnimationManager.cs
BattleMuscle/Assets/My/Scripts/AI/BossAnimationManager.cs
+54
-7
BossAttack.cs
BattleMuscle/Assets/My/Scripts/AI/BossAttack.cs
+16
-3
BossAttackDamageRange.cs
BattleMuscle/Assets/My/Scripts/AI/BossAttackDamageRange.cs
+1
-1
BossMove.cs
BattleMuscle/Assets/My/Scripts/AI/BossMove.cs
+17
-7
AttackTrigger.cs
BattleMuscle/Assets/My/Scripts/Player/AttackTrigger.cs
+10
-3
PlayerMove.cs
BattleMuscle/Assets/My/Scripts/Player/PlayerMove.cs
+1
-0
No files found.
BattleMuscle/Assets/Art_Assets/Animation/AnimationController/Running2.controller
View file @
b24f623e
...
@@ -24,10 +24,14 @@ AnimatorStateMachine:
...
@@ -24,10 +24,14 @@ AnimatorStateMachine:
-
serializedVersion
:
1
-
serializedVersion
:
1
m_State
:
{
fileID
:
5730630131191024332
}
m_State
:
{
fileID
:
5730630131191024332
}
m_Position
:
{
x
:
-30
,
y
:
350
,
z
:
0
}
m_Position
:
{
x
:
-30
,
y
:
350
,
z
:
0
}
-
serializedVersion
:
1
m_State
:
{
fileID
:
5232131748971255912
}
m_Position
:
{
x
:
-260
,
y
:
240
,
z
:
0
}
m_ChildStateMachines
:
[]
m_ChildStateMachines
:
[]
m_AnyStateTransitions
:
m_AnyStateTransitions
:
-
{
fileID
:
-
988131835395953829
}
-
{
fileID
:
-
5157424812580719683
}
-
{
fileID
:
8973507764031670339
}
-
{
fileID
:
8973507764031670339
}
-
{
fileID
:
2005904175553675675
}
m_EntryTransitions
:
[]
m_EntryTransitions
:
[]
m_StateMachineTransitions
:
{}
m_StateMachineTransitions
:
{}
m_StateMachineBehaviours
:
[]
m_StateMachineBehaviours
:
[]
...
@@ -140,19 +144,22 @@ AnimatorState:
...
@@ -140,19 +144,22 @@ AnimatorState:
m_MirrorParameter
:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
MoveSpeed
m_TimeParameter
:
MoveSpeed
---
!u!1101
&-
4809412122287805464
---
!u!1101
&-
5157424812580719683
AnimatorStateTransition
:
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_Name
:
m_Conditions
:
[]
m_Conditions
:
-
m_ConditionMode
:
1
m_ConditionEvent
:
IsFirstHurricaneKickBefor
m_EventTreshold
:
0
m_DstStateMachine
:
{
fileID
:
0
}
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
5232131748971255912
}
m_Solo
:
0
m_Solo
:
0
m_Mute
:
0
m_Mute
:
0
m_IsExit
:
1
m_IsExit
:
0
serializedVersion
:
3
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_TransitionOffset
:
0
...
@@ -162,32 +169,29 @@ AnimatorStateTransition:
...
@@ -162,32 +169,29 @@ AnimatorStateTransition:
m_InterruptionSource
:
0
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
m_CanTransitionToSelf
:
1
---
!u!1101
&-
1429333520268681619
---
!u!1101
&-
4809412122287805464
AnimatorStateTransition
:
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_Name
:
m_Conditions
:
m_Conditions
:
[]
-
m_ConditionMode
:
4
m_ConditionEvent
:
MoveSpeed
m_EventTreshold
:
0.2
m_DstStateMachine
:
{
fileID
:
0
}
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
5730630131191024332
}
m_DstState
:
{
fileID
:
0
}
m_Solo
:
0
m_Solo
:
0
m_Mute
:
0
m_Mute
:
0
m_IsExit
:
0
m_IsExit
:
1
serializedVersion
:
3
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_TransitionOffset
:
0
m_ExitTime
:
0.
6428572
m_ExitTime
:
0.
75
m_HasExitTime
:
0
m_HasExitTime
:
1
m_HasFixedDuration
:
1
m_HasFixedDuration
:
1
m_InterruptionSource
:
0
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
m_CanTransitionToSelf
:
1
---
!u!1101
&-
98813183539595382
9
---
!u!1101
&-
142933352026868161
9
AnimatorStateTransition
:
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
...
@@ -195,18 +199,18 @@ AnimatorStateTransition:
...
@@ -195,18 +199,18 @@ AnimatorStateTransition:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_Name
:
m_Conditions
:
m_Conditions
:
-
m_ConditionMode
:
1
-
m_ConditionMode
:
4
m_ConditionEvent
:
HurricaneKick
m_ConditionEvent
:
MoveSpeed
m_EventTreshold
:
0
m_EventTreshold
:
0
.2
m_DstStateMachine
:
{
fileID
:
0
}
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
4471307210666310047
}
m_DstState
:
{
fileID
:
5730630131191024332
}
m_Solo
:
0
m_Solo
:
0
m_Mute
:
0
m_Mute
:
0
m_IsExit
:
0
m_IsExit
:
0
serializedVersion
:
3
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_TransitionOffset
:
0
m_ExitTime
:
0.
75
m_ExitTime
:
0.
6428572
m_HasExitTime
:
0
m_HasExitTime
:
0
m_HasFixedDuration
:
1
m_HasFixedDuration
:
1
m_InterruptionSource
:
0
m_InterruptionSource
:
0
...
@@ -254,19 +258,31 @@ AnimatorController:
...
@@ -254,19 +258,31 @@ AnimatorController:
m_DefaultFloat
:
0
m_DefaultFloat
:
0
m_DefaultInt
:
0
m_DefaultInt
:
0
m_DefaultBool
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
910000
0
}
m_Controller
:
{
fileID
:
0
}
-
m_Name
:
LegSweep
-
m_Name
:
LegSweep
m_Type
:
4
m_Type
:
4
m_DefaultFloat
:
0
m_DefaultFloat
:
0
m_DefaultInt
:
0
m_DefaultInt
:
0
m_DefaultBool
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
910000
0
}
m_Controller
:
{
fileID
:
0
}
-
m_Name
:
HurricaneKick
-
m_Name
:
HurricaneKick
m_Type
:
4
m_Type
:
4
m_DefaultFloat
:
0
m_DefaultFloat
:
0
m_DefaultInt
:
0
m_DefaultInt
:
0
m_DefaultBool
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
9100000
}
m_Controller
:
{
fileID
:
0
}
-
m_Name
:
HurricaneKickBefor
m_Type
:
4
m_DefaultFloat
:
0
m_DefaultInt
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
0
}
-
m_Name
:
IsFirstHurricaneKickBefor
m_Type
:
4
m_DefaultFloat
:
0
m_DefaultInt
:
0
m_DefaultBool
:
0
m_Controller
:
{
fileID
:
0
}
m_AnimatorLayers
:
m_AnimatorLayers
:
-
serializedVersion
:
5
-
serializedVersion
:
5
m_Name
:
Base Layer
m_Name
:
Base Layer
...
@@ -280,6 +296,31 @@ AnimatorController:
...
@@ -280,6 +296,31 @@ AnimatorController:
m_IKPass
:
0
m_IKPass
:
0
m_SyncedLayerAffectsTiming
:
0
m_SyncedLayerAffectsTiming
:
0
m_Controller
:
{
fileID
:
9100000
}
m_Controller
:
{
fileID
:
9100000
}
---
!u!1101
&2005904175553675675
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
:
HurricaneKick
m_EventTreshold
:
0
m_DstStateMachine
:
{
fileID
:
0
}
m_DstState
:
{
fileID
:
4471307210666310047
}
m_Solo
:
0
m_Mute
:
0
m_IsExit
:
0
serializedVersion
:
3
m_TransitionDuration
:
0.25
m_TransitionOffset
:
0
m_ExitTime
:
0.75
m_HasExitTime
:
1
m_HasFixedDuration
:
1
m_InterruptionSource
:
0
m_OrderedInterruption
:
1
m_CanTransitionToSelf
:
1
---
!u!1101
&2335692240658299194
---
!u!1101
&2335692240658299194
AnimatorStateTransition
:
AnimatorStateTransition
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
...
@@ -357,7 +398,33 @@ AnimatorState:
...
@@ -357,7 +398,33 @@ AnimatorState:
m_SpeedParameter
:
m_SpeedParameter
:
m_MirrorParameter
:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
m_TimeParameter
:
aaa
---
!u!1102
&5232131748971255912
AnimatorState
:
serializedVersion
:
5
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
HurricaneKickBefor
m_Speed
:
1
m_CycleOffset
:
0
m_Transitions
:
[]
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
:
d266a3801edfb2d4ebf814eeea93f5d2
,
type
:
2
}
m_Tag
:
m_SpeedParameter
:
MoveSpeed
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
aaa
---
!u!1102
&5730630131191024332
---
!u!1102
&5730630131191024332
AnimatorState
:
AnimatorState
:
serializedVersion
:
5
serializedVersion
:
5
...
...
BattleMuscle/Assets/Levels/Level 1.unity
View file @
b24f623e
This diff is collapsed.
Click to expand it.
BattleMuscle/Assets/My/HurricaneKickBefor.anim
0 → 100644
View file @
b24f623e
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!74
&7400000
AnimationClip
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
HurricaneKickBefor
serializedVersion
:
6
m_Legacy
:
0
m_Compressed
:
0
m_UseHighQualityCurve
:
1
m_RotationCurves
:
[]
m_CompressedRotationCurves
:
[]
m_EulerCurves
:
[]
m_PositionCurves
:
[]
m_ScaleCurves
:
[]
m_FloatCurves
:
[]
m_PPtrCurves
:
[]
m_SampleRate
:
60
m_WrapMode
:
0
m_Bounds
:
m_Center
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_Extent
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_ClipBindingConstant
:
genericBindings
:
[]
pptrCurveMapping
:
[]
m_AnimationClipSettings
:
serializedVersion
:
2
m_AdditiveReferencePoseClip
:
{
fileID
:
0
}
m_AdditiveReferencePoseTime
:
0
m_StartTime
:
0
m_StopTime
:
0.98333335
m_OrientationOffsetY
:
0
m_Level
:
0
m_CycleOffset
:
0
m_HasAdditiveReferencePose
:
0
m_LoopTime
:
1
m_LoopBlend
:
0
m_LoopBlendOrientation
:
0
m_LoopBlendPositionY
:
0
m_LoopBlendPositionXZ
:
0
m_KeepOriginalOrientation
:
0
m_KeepOriginalPositionY
:
1
m_KeepOriginalPositionXZ
:
0
m_HeightFromFeet
:
0
m_Mirror
:
0
m_EditorCurves
:
[]
m_EulerEditorCurves
:
[]
m_HasGenericRootTransform
:
0
m_HasMotionFloatCurves
:
0
m_Events
:
-
time
:
0.98333335
functionName
:
HurricaneKickBeforEnd
data
:
objectReferenceParameter
:
{
fileID
:
0
}
floatParameter
:
0
intParameter
:
0
messageOptions
:
0
BattleMuscle/Assets/My/HurricaneKickBefor.anim.meta
0 → 100644
View file @
b24f623e
fileFormatVersion: 2
guid: d266a3801edfb2d4ebf814eeea93f5d2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
BattleMuscle/Assets/My/Model/HurricaneKickTrigger.prefab
View file @
b24f623e
...
@@ -50,7 +50,7 @@ MeshRenderer:
...
@@ -50,7 +50,7 @@ MeshRenderer:
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7483224581113721909
}
m_GameObject
:
{
fileID
:
7483224581113721909
}
m_Enabled
:
1
m_Enabled
:
0
m_CastShadows
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_DynamicOccludee
:
1
...
...
BattleMuscle/Assets/My/Model/LegSweepTrigger.prefab
View file @
b24f623e
...
@@ -50,7 +50,7 @@ MeshRenderer:
...
@@ -50,7 +50,7 @@ MeshRenderer:
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6039842180593449807
}
m_GameObject
:
{
fileID
:
6039842180593449807
}
m_Enabled
:
1
m_Enabled
:
0
m_CastShadows
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_DynamicOccludee
:
1
...
...
BattleMuscle/Assets/My/Scripts/AI/BossAnimationManager.cs
View file @
b24f623e
...
@@ -6,16 +6,32 @@ public enum BossAnimationState
...
@@ -6,16 +6,32 @@ public enum BossAnimationState
{
{
LegSweep
=
1
,
LegSweep
=
1
,
HurricaneKick
=
2
,
HurricaneKick
=
2
,
NotAttack
=
3
NotAttack
=
3
,
}
}
public
class
BossAnimationManager
:
MonoBehaviour
public
class
BossAnimationManager
:
MonoBehaviour
{
{
private
Animator
animator
;
private
Animator
animator
;
private
float
HurricaneKickTimer
=
0
;
public
bool
IsFirstHurricaneKickBefor
=
true
;
void
Start
()
void
Start
()
{
{
animator
=
GetComponentInChildren
<
Animator
>();
animator
=
GetComponentInChildren
<
Animator
>();
}
}
private
void
Update
()
{
if
(!
IsFirstHurricaneKickBefor
)
{
HurricaneKickTimer
+=
Time
.
deltaTime
;
}
else
{
HurricaneKickTimer
=
0
;
}
}
public
void
ChangeAnimatorState
(
BossAnimationState
state
)
public
void
ChangeAnimatorState
(
BossAnimationState
state
)
{
{
...
@@ -24,20 +40,45 @@ public class BossAnimationManager : MonoBehaviour
...
@@ -24,20 +40,45 @@ public class BossAnimationManager : MonoBehaviour
{
{
case
BossAnimationState
.
LegSweep
:
case
BossAnimationState
.
LegSweep
:
IsFirstHurricaneKickBefor
=
true
;
HurricaneKickTimer
=
0
;
animator
.
SetBool
(
"HurricaneKick"
,
false
);
animator
.
SetBool
(
"HurricaneKick"
,
false
);
animator
.
SetBool
(
"LegSweep"
,
true
);
animator
.
SetBool
(
"LegSweep"
,
true
);
animator
.
SetFloat
(
"MoveSpeed"
,
0
);
animator
.
SetFloat
(
"MoveSpeed"
,
0
);
break
;
break
;
case
BossAnimationState
.
HurricaneKick
:
case
BossAnimationState
.
HurricaneKick
:
//--------第一次旋转需要停留一秒钟----------------------------------------------
if
(
IsFirstHurricaneKickBefor
)
{
IsFirstHurricaneKickBefor
=
false
;
}
if
(
HurricaneKickTimer
<=
1f
)
{
print
(
"第一次播放。"
);
animator
.
SetBool
(
"IsFirstHurricaneKickBefor"
,
true
);
}
else
{
print
(
"不是第一次播放。"
);
animator
.
SetBool
(
"IsFirstHurricaneKickBefor"
,
false
);
animator
.
SetBool
(
"HurricaneKickBefor"
,
true
);
animator
.
SetBool
(
"HurricaneKick"
,
true
);
animator
.
SetBool
(
"HurricaneKick"
,
true
);
animator
.
SetBool
(
"LegSweep"
,
false
);
animator
.
SetBool
(
"LegSweep"
,
false
);
animator
.
SetFloat
(
"MoveSpeed"
,
0
)
;
animator
.
SetFloat
(
"MoveSpeed"
,
0
);
}
break
;
break
;
case
BossAnimationState
.
NotAttack
:
case
BossAnimationState
.
NotAttack
:
IsFirstHurricaneKickBefor
=
true
;
HurricaneKickTimer
=
0
;
animator
.
SetBool
(
"HurricaneKick"
,
false
);
animator
.
SetBool
(
"HurricaneKick"
,
false
);
animator
.
SetBool
(
"LegSweep"
,
false
);
animator
.
SetBool
(
"LegSweep"
,
false
);
break
;
break
;
default
:
default
:
IsFirstHurricaneKickBefor
=
true
;
HurricaneKickTimer
=
0
;
animator
.
SetBool
(
"HurricaneKick"
,
false
);
animator
.
SetBool
(
"HurricaneKick"
,
false
);
animator
.
SetBool
(
"LegSweep"
,
false
);
animator
.
SetBool
(
"LegSweep"
,
false
);
Debug
.
LogError
(
state
);
Debug
.
LogError
(
state
);
...
@@ -45,6 +86,12 @@ public class BossAnimationManager : MonoBehaviour
...
@@ -45,6 +86,12 @@ public class BossAnimationManager : MonoBehaviour
}
}
}
}
//public void SetIsFirstHurricaneKickBefor()
//{
// animator.SetBool("IsFirstHurricaneKickBefor", false);
//}
}
}
BattleMuscle/Assets/My/Scripts/AI/BossAttack.cs
View file @
b24f623e
...
@@ -21,11 +21,14 @@ public class BossAttack : MonoBehaviour
...
@@ -21,11 +21,14 @@ public class BossAttack : MonoBehaviour
public
AttackType
attackType
=
AttackType
.
Null
;
public
AttackType
attackType
=
AttackType
.
Null
;
private
Animator
animator
;
public
BossAnimationManager
bossAnimationManager
;
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
{
{
animator
=
GetComponentInChildren
<
Animator
>();
}
}
// Update is called once per frame
// Update is called once per frame
...
@@ -63,6 +66,16 @@ public class BossAttack : MonoBehaviour
...
@@ -63,6 +66,16 @@ public class BossAttack : MonoBehaviour
print
(
"改变boss攻击状态为:"
+
attackType
);
print
(
"改变boss攻击状态为:"
+
attackType
);
}
}
public
void
HurricaneKickBeforEnable
()
{
animator
.
SetBool
(
"HurricaneKickBefor"
,
false
);
}
/// <summary>
/// HurricaneKickBefor状态结束时调用。
/// </summary>
public
void
HurricaneKickBeforEnd
()
{
animator
.
SetBool
(
"HurricaneKickBefor"
,
false
);
animator
.
SetBool
(
"HurricaneKick"
,
true
);
}
}
}
BattleMuscle/Assets/My/Scripts/AI/BossAttackDamageRange.cs
View file @
b24f623e
...
@@ -34,7 +34,7 @@ public class BossAttackDamageRange : MonoBehaviour
...
@@ -34,7 +34,7 @@ public class BossAttackDamageRange : MonoBehaviour
other
.
gameObject
.
GetComponentInChildren
<
AIMove
>().
Hurt
(
0.5f
);
other
.
gameObject
.
GetComponentInChildren
<
AIMove
>().
Hurt
(
0.5f
);
ps
=
Instantiate
(
hitEffects
,
hitPos
,
transform
.
rotation
);
ps
=
Instantiate
(
hitEffects
,
hitPos
,
transform
.
rotation
);
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
Handheld
.
Vibrate
();
//手机震动
//
Handheld.Vibrate();//手机震动
}
}
}
}
...
...
BattleMuscle/Assets/My/Scripts/AI/BossMove.cs
View file @
b24f623e
...
@@ -35,7 +35,7 @@ public class BossMove : MonoBehaviour
...
@@ -35,7 +35,7 @@ public class BossMove : MonoBehaviour
[
Header
(
"旋风腿"
)]
[
Header
(
"旋风腿"
)]
[
Tooltip
(
"旋风腿持续时间"
)]
[
Tooltip
(
"旋风腿持续时间"
)]
public
float
HurricaneKickDuration
=
3
;
public
float
HurricaneKickDuration
=
1.5f
;
public
float
CurrentHurricaneKickDuration
=
0
;
public
float
CurrentHurricaneKickDuration
=
0
;
[
Tooltip
(
"旋风腿冷却时间"
)]
[
Tooltip
(
"旋风腿冷却时间"
)]
public
float
HurricaneKickCoolingTime
=
5
;
public
float
HurricaneKickCoolingTime
=
5
;
...
@@ -45,8 +45,8 @@ public class BossMove : MonoBehaviour
...
@@ -45,8 +45,8 @@ public class BossMove : MonoBehaviour
[
Header
(
"扫腿"
)]
[
Header
(
"扫腿"
)]
[
Tooltip
(
"扫腿冷却时间"
)]
[
Tooltip
(
"扫腿冷却时间"
)]
public
float
LegSweep
Duration
=
2
;
public
float
LegSweep
CoolingTime
=
3
;
public
float
CurrentLegSweep
Duration
=
0
;
public
float
CurrentLegSweep
CoolingTime
=
0
;
[
Tooltip
(
"扫腿技能是否处于冷却中"
)]
[
Tooltip
(
"扫腿技能是否处于冷却中"
)]
public
bool
isDeltaTime2
=
false
;
public
bool
isDeltaTime2
=
false
;
...
@@ -57,6 +57,9 @@ public class BossMove : MonoBehaviour
...
@@ -57,6 +57,9 @@ public class BossMove : MonoBehaviour
private
bool
IsCanMove
=
true
;
private
bool
IsCanMove
=
true
;
private
bool
isHurricaneKick
=
false
;
private
bool
isHurricaneKick
=
false
;
public
ParticleSystem
ps
;
public
ParticleSystem
ps2
;
...
@@ -159,10 +162,12 @@ public class BossMove : MonoBehaviour
...
@@ -159,10 +162,12 @@ public class BossMove : MonoBehaviour
if
(
isDeltaTime2
)
if
(
isDeltaTime2
)
{
{
//扫腿处于冷却中。
//扫腿处于冷却中。
CurrentLegSweepDuration
+=
Time
.
deltaTime
;
print
(
"扫腿冷却中"
);
if
(
CurrentLegSweepDuration
>=
LegSweepDuration
)
CurrentLegSweepCoolingTime
+=
Time
.
deltaTime
;
if
(
CurrentLegSweepCoolingTime
>=
LegSweepCoolingTime
)
{
{
CurrentLegSweepDuration
=
0
;
print
(
"扫腿冷却完毕"
);
CurrentLegSweepCoolingTime
=
0
;
isDeltaTime2
=
false
;
isDeltaTime2
=
false
;
}
}
}
}
...
@@ -234,6 +239,9 @@ public class BossMove : MonoBehaviour
...
@@ -234,6 +239,9 @@ public class BossMove : MonoBehaviour
{
{
//附近有2个人就触发,技能好了就等待,当前播放的动画不是扫腿就开始播放旋风腿。
//附近有2个人就触发,技能好了就等待,当前播放的动画不是扫腿就开始播放旋风腿。
print
(
"旋风腿"
);
print
(
"旋风腿"
);
ps
.
Play
();
ps2
.
Play
();
CurrentHurricaneKickDuration
+=
Time
.
deltaTime
;
//旋风腿持续时间减少
CurrentHurricaneKickDuration
+=
Time
.
deltaTime
;
//旋风腿持续时间减少
if
(
CurrentHurricaneKickDuration
>=
HurricaneKickDuration
)
if
(
CurrentHurricaneKickDuration
>=
HurricaneKickDuration
)
{
{
...
@@ -241,6 +249,8 @@ public class BossMove : MonoBehaviour
...
@@ -241,6 +249,8 @@ public class BossMove : MonoBehaviour
isDeltaTime
=
true
;
isDeltaTime
=
true
;
isHurricaneKick
=
false
;
isHurricaneKick
=
false
;
//重新计时冷却时间
//重新计时冷却时间
ps
.
Stop
();
ps2
.
Stop
();
CurrentHurricaneKickCoolingTime
=
0
;
CurrentHurricaneKickCoolingTime
=
0
;
CurrentHurricaneKickDuration
=
0
;
CurrentHurricaneKickDuration
=
0
;
}
}
...
...
BattleMuscle/Assets/My/Scripts/Player/AttackTrigger.cs
View file @
b24f623e
...
@@ -51,7 +51,7 @@ public class AttackTrigger : MonoBehaviour
...
@@ -51,7 +51,7 @@ public class AttackTrigger : MonoBehaviour
other
.
gameObject
.
GetComponentInChildren
<
PlayerMove
>().
Hurt
(
0.5f
);
other
.
gameObject
.
GetComponentInChildren
<
PlayerMove
>().
Hurt
(
0.5f
);
ps
=
Instantiate
(
hitEffects
,
hitPos
.
transform
.
position
,
hitPos
.
transform
.
rotation
);
ps
=
Instantiate
(
hitEffects
,
hitPos
.
transform
.
position
,
hitPos
.
transform
.
rotation
);
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
Handheld
.
Vibrate
();
//手机震动
//
Handheld.Vibrate();//手机震动
}
}
else
if
(
other
.
tag
==
"Competitor"
)
else
if
(
other
.
tag
==
"Competitor"
)
...
@@ -59,7 +59,11 @@ public class AttackTrigger : MonoBehaviour
...
@@ -59,7 +59,11 @@ public class AttackTrigger : MonoBehaviour
other
.
gameObject
.
GetComponentInChildren
<
AIMove
>().
Hurt
(
0.5f
);
other
.
gameObject
.
GetComponentInChildren
<
AIMove
>().
Hurt
(
0.5f
);
ps
=
Instantiate
(
hitEffects
,
hitPos
.
transform
.
position
,
hitPos
.
transform
.
rotation
);
ps
=
Instantiate
(
hitEffects
,
hitPos
.
transform
.
position
,
hitPos
.
transform
.
rotation
);
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
if
(
Root
.
tag
==
"Player"
)
{
Handheld
.
Vibrate
();
//手机震动
Handheld
.
Vibrate
();
//手机震动
}
}
}
else
if
(
other
.
tag
==
"Boss"
)
else
if
(
other
.
tag
==
"Boss"
)
...
@@ -67,7 +71,10 @@ public class AttackTrigger : MonoBehaviour
...
@@ -67,7 +71,10 @@ public class AttackTrigger : MonoBehaviour
other
.
gameObject
.
GetComponentInChildren
<
BossMove
>().
Hurt
(
1
);
other
.
gameObject
.
GetComponentInChildren
<
BossMove
>().
Hurt
(
1
);
ps
=
Instantiate
(
hitEffects
,
hitPos
.
transform
.
position
,
hitPos
.
transform
.
rotation
);
ps
=
Instantiate
(
hitEffects
,
hitPos
.
transform
.
position
,
hitPos
.
transform
.
rotation
);
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
ps
.
gameObject
.
AddComponent
<
DestroyMySel
>();
if
(
Root
.
tag
==
"Player"
)
{
Handheld
.
Vibrate
();
//手机震动
Handheld
.
Vibrate
();
//手机震动
}
if
(
Root
.
name
==
"Player"
)
if
(
Root
.
name
==
"Player"
)
{
{
Root
.
GetComponentInChildren
<
PlayerMove
>().
UpdateScore
(
2
);
Root
.
GetComponentInChildren
<
PlayerMove
>().
UpdateScore
(
2
);
...
...
BattleMuscle/Assets/My/Scripts/Player/PlayerMove.cs
View file @
b24f623e
...
@@ -74,6 +74,7 @@ public class PlayerMove : MonoBehaviour
...
@@ -74,6 +74,7 @@ public class PlayerMove : MonoBehaviour
if
(
other
.
tag
==
"Food"
)
if
(
other
.
tag
==
"Food"
)
{
{
//print("吃到食物。");
//print("吃到食物。");
Handheld
.
Vibrate
();
//手机震动
UpdateScore
(
1
);
UpdateScore
(
1
);
if
(
scale
>=
(
1
+
MaxFood
*
addScale
))
if
(
scale
>=
(
1
+
MaxFood
*
addScale
))
{
{
...
...
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