Commit 3c1a7b98 authored by czy's avatar czy

添加boss动画管理器

parent 062757c0
...@@ -368,7 +368,7 @@ public class BattleUI : MonoBehaviour ...@@ -368,7 +368,7 @@ public class BattleUI : MonoBehaviour
//设置战斗UI状态 //设置战斗UI状态
public void SetBattleObjState(bool bool_) public void SetBattleObjState(bool bool_)
{ {
print("显示m_battleObj:"+bool_); //print("显示m_battleObj:"+bool_);
m_battleObj.SetActive(bool_); m_battleObj.SetActive(bool_);
//m_successResultObj.SetActive(bool_); //m_successResultObj.SetActive(bool_);
//m_successResultMaskObj.SetActive(!bool_); //m_successResultMaskObj.SetActive(!bool_);
...@@ -502,7 +502,7 @@ public class BattleUI : MonoBehaviour ...@@ -502,7 +502,7 @@ public class BattleUI : MonoBehaviour
} }
public void UpdateScore2(string name,string text) public void UpdateScore2(string name,string text)
{ {
print("name:" + name + ",text" + text); //print("name:" + name + ",text" + text);
switch (name) switch (name)
{ {
case "Player": case "Player":
......
...@@ -36,7 +36,7 @@ AnimationClip: ...@@ -36,7 +36,7 @@ AnimationClip:
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
m_HasAdditiveReferencePose: 0 m_HasAdditiveReferencePose: 0
m_LoopTime: 1 m_LoopTime: 0
m_LoopBlend: 0 m_LoopBlend: 0
m_LoopBlendOrientation: 0 m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0 m_LoopBlendPositionY: 0
......
...@@ -22354,4 +22354,11 @@ AnimationClip: ...@@ -22354,4 +22354,11 @@ AnimationClip:
script: {fileID: 0} script: {fileID: 0}
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 0
functionName: ChangeAttackType
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
...@@ -11,26 +11,31 @@ AnimatorStateMachine: ...@@ -11,26 +11,31 @@ AnimatorStateMachine:
m_ChildStates: m_ChildStates:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -7856523028850394630} m_State: {fileID: -7856523028850394630}
m_Position: {x: -180, y: 200, z: 0} m_Position: {x: -30, y: 550, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 4471307210666310047} m_State: {fileID: 4471307210666310047}
m_Position: {x: -220, y: 320, z: 0} m_Position: {x: -270, y: 340, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -340101015679708446} m_State: {fileID: -340101015679708446}
m_Position: {x: 30, y: 460, z: 0} m_Position: {x: -580, y: 350, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -5355840141299690807} m_State: {fileID: -5355840141299690807}
m_Position: {x: 30, y: 330, z: 0} m_Position: {x: -440, y: 500, z: 0}
- serializedVersion: 1
m_State: {fileID: 5730630131191024332}
m_Position: {x: -30, y: 350, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions:
- {fileID: -988131835395953829}
- {fileID: 8973507764031670339}
m_EntryTransitions: [] m_EntryTransitions: []
m_StateMachineTransitions: {} m_StateMachineTransitions: {}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0} m_AnyStatePosition: {x: -430, y: 200, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0} m_EntryPosition: {x: -10, y: 120, z: 0}
m_ExitPosition: {x: 80, y: 620, z: 0} m_ExitPosition: {x: -420, y: 610, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -5355840141299690807} m_DefaultState: {fileID: 5730630131191024332}
--- !u!1102 &-7856523028850394630 --- !u!1102 &-7856523028850394630
AnimatorState: AnimatorState:
serializedVersion: 5 serializedVersion: 5
...@@ -42,7 +47,7 @@ AnimatorState: ...@@ -42,7 +47,7 @@ AnimatorState:
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions:
- {fileID: 9215743797728680209} - {fileID: -1429333520268681619}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
...@@ -58,6 +63,56 @@ AnimatorState: ...@@ -58,6 +63,56 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1101 &-6201182350460217250
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: LegSweep
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -7856523028850394630}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.89285713
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-5535950680375300128
AnimatorStateTransition:
m_ObjectHideFlags: 1
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: -7856523028850394630}
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!1102 &-5355840141299690807 --- !u!1102 &-5355840141299690807
AnimatorState: AnimatorState:
serializedVersion: 5 serializedVersion: 5
...@@ -69,9 +124,7 @@ AnimatorState: ...@@ -69,9 +124,7 @@ AnimatorState:
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions:
- {fileID: -1573847190218674684} - {fileID: -4809412122287805464}
- {fileID: 8852921774420047574}
- {fileID: 6084528436147092541}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
...@@ -86,8 +139,30 @@ AnimatorState: ...@@ -86,8 +139,30 @@ AnimatorState:
m_SpeedParameter: m_SpeedParameter:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter: MoveSpeed
--- !u!1101 &-1573847190218674684 --- !u!1101 &-4809412122287805464
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
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.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-1429333520268681619
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
...@@ -95,11 +170,36 @@ AnimatorStateTransition: ...@@ -95,11 +170,36 @@ AnimatorStateTransition:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: m_Name:
m_Conditions: m_Conditions:
- m_ConditionMode: 3 - m_ConditionMode: 4
m_ConditionEvent: MoveSpeed m_ConditionEvent: MoveSpeed
m_EventTreshold: 0.2 m_EventTreshold: 0.2
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -7856523028850394630} m_DstState: {fileID: 5730630131191024332}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.6428572
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-988131835395953829
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_Solo: 0
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
...@@ -124,6 +224,7 @@ AnimatorState: ...@@ -124,6 +224,7 @@ AnimatorState:
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions:
- {fileID: 4032888935653943640} - {fileID: 4032888935653943640}
- {fileID: -6201182350460217250}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
...@@ -179,6 +280,31 @@ AnimatorController: ...@@ -179,6 +280,31 @@ AnimatorController:
m_IKPass: 0 m_IKPass: 0
m_SyncedLayerAffectsTiming: 0 m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
--- !u!1101 &2335692240658299194
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: HurricaneKick
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -7856523028850394630}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.8636364
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &4032888935653943640 --- !u!1101 &4032888935653943640
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -193,7 +319,7 @@ AnimatorStateTransition: ...@@ -193,7 +319,7 @@ AnimatorStateTransition:
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5355840141299690807} m_DstState: {fileID: -5355840141299690807}
m_Solo: 0 m_Solo: 0
m_Mute: 0 m_Mute: 1
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.25
...@@ -216,6 +342,7 @@ AnimatorState: ...@@ -216,6 +342,7 @@ AnimatorState:
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions:
- {fileID: 6957880257579340654} - {fileID: 6957880257579340654}
- {fileID: 2335692240658299194}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
...@@ -231,31 +358,33 @@ AnimatorState: ...@@ -231,31 +358,33 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1101 &6084528436147092541 --- !u!1102 &5730630131191024332
AnimatorStateTransition: AnimatorState:
m_ObjectHideFlags: 1 serializedVersion: 5
m_ObjectHideFlags: 3
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: Idle2
m_Conditions: m_Speed: 1
- m_ConditionMode: 1 m_CycleOffset: 0
m_ConditionEvent: HurricaneKick m_Transitions:
m_EventTreshold: 0 - {fileID: -5535950680375300128}
m_DstStateMachine: {fileID: 0} m_StateMachineBehaviours: []
m_DstState: {fileID: 4471307210666310047} m_Position: {x: 50, y: 50, z: 0}
m_Solo: 0 m_IKOnFeet: 0
m_Mute: 0 m_WriteDefaultValues: 1
m_IsExit: 0 m_Mirror: 0
serializedVersion: 3 m_SpeedParameterActive: 0
m_TransitionDuration: 0.18607777 m_MirrorParameterActive: 0
m_TransitionOffset: 0 m_CycleOffsetParameterActive: 0
m_ExitTime: 0.7942538 m_TimeParameterActive: 0
m_HasExitTime: 0 m_Motion: {fileID: 7400000, guid: 5ee8ce777d6cb89459716b5e56ad39a5, type: 2}
m_HasFixedDuration: 1 m_Tag:
m_InterruptionSource: 0 m_SpeedParameter:
m_OrderedInterruption: 1 m_MirrorParameter:
m_CanTransitionToSelf: 1 m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &6957880257579340654 --- !u!1101 &6957880257579340654
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -270,43 +399,40 @@ AnimatorStateTransition: ...@@ -270,43 +399,40 @@ AnimatorStateTransition:
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5355840141299690807} m_DstState: {fileID: -5355840141299690807}
m_Solo: 0 m_Solo: 0
m_Mute: 0 m_Mute: 1
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.03374338 m_TransitionDuration: 0.03374338
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.9815945 m_ExitTime: 0.9815945
m_HasExitTime: 1 m_HasExitTime: 0
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 &8852921774420047574 --- !u!1101 &7648654103078084003
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 3
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: LegSweep
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -340101015679708446} 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.75 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 &9215743797728680209 --- !u!1101 &8973507764031670339
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
...@@ -314,18 +440,18 @@ AnimatorStateTransition: ...@@ -314,18 +440,18 @@ AnimatorStateTransition:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: m_Name:
m_Conditions: m_Conditions:
- m_ConditionMode: 4 - m_ConditionMode: 1
m_ConditionEvent: MoveSpeed m_ConditionEvent: LegSweep
m_EventTreshold: 0.2 m_EventTreshold: 0
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5355840141299690807} m_DstState: {fileID: -340101015679708446}
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.6428572 m_ExitTime: 0.75
m_HasExitTime: 0 m_HasExitTime: 0
m_HasFixedDuration: 1 m_HasFixedDuration: 1
m_InterruptionSource: 0 m_InterruptionSource: 0
......
...@@ -262,17 +262,17 @@ PrefabInstance: ...@@ -262,17 +262,17 @@ PrefabInstance:
- target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 1 value: 0.8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
propertyPath: m_LocalScale.y propertyPath: m_LocalScale.y
value: 1 value: 0.8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 1 value: 0.8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -927199367670048503, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
...@@ -2386,8 +2386,8 @@ MonoBehaviour: ...@@ -2386,8 +2386,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3} m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
foodNumber: 20 foodNumber: 100
timeSpan: 10 timeSpan: 2
foodPoint: foodPoint:
- {fileID: 1752813316} - {fileID: 1752813316}
- {fileID: 1547259537} - {fileID: 1547259537}
...@@ -6945,6 +6945,7 @@ GameObject: ...@@ -6945,6 +6945,7 @@ GameObject:
- component: {fileID: 557966604} - component: {fileID: 557966604}
- component: {fileID: 557966602} - component: {fileID: 557966602}
- component: {fileID: 557966603} - component: {fileID: 557966603}
- component: {fileID: 557966605}
m_Layer: 0 m_Layer: 0
m_Name: Boss m_Name: Boss
m_TagString: Boss m_TagString: Boss
...@@ -7015,7 +7016,7 @@ MonoBehaviour: ...@@ -7015,7 +7016,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
VSpeed: 10 VSpeed: 10
life: 30 life: 300
scale: 1 scale: 1
MinScale: 0.2 MinScale: 0.2
targetList: targetList:
...@@ -7025,9 +7026,27 @@ MonoBehaviour: ...@@ -7025,9 +7026,27 @@ MonoBehaviour:
MoveSpeed: 0 MoveSpeed: 0
BirthplacePos: {fileID: 225105685} BirthplacePos: {fileID: 225105685}
EnemyNumber: 0 EnemyNumber: 0
Timer1: 0 HurricaneKickDuration: 1.5
CurrentHurricaneKickDuration: 0
HurricaneKickCoolingTime: 5
CurrentHurricaneKickCoolingTime: 0
isDeltaTime: 0 isDeltaTime: 0
LegSweepDuration: 2
CurrentLegSweepDuration: 0
isDeltaTime2: 0
bossState: 0 bossState: 0
--- !u!114 &557966605
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 557966600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 17ab4b61d0b362349828e661a3b978a3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &560627449 stripped --- !u!4 &560627449 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 5957448836295836418, guid: 15d49ef1e12d35a46b7c6fb953021b43, m_CorrespondingSourceObject: {fileID: 5957448836295836418, guid: 15d49ef1e12d35a46b7c6fb953021b43,
...@@ -18506,8 +18525,8 @@ MonoBehaviour: ...@@ -18506,8 +18525,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3} m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
foodNumber: 20 foodNumber: 100
timeSpan: 10 timeSpan: 2
foodPoint: foodPoint:
- {fileID: 297527856} - {fileID: 297527856}
- {fileID: 1128247090} - {fileID: 1128247090}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum BossAnimationState
{
LegSweep=1,
HurricaneKick=2,
NotAttack=3
}
public class BossAnimationManager : MonoBehaviour
{
private Animator animator;
void Start()
{
animator = GetComponentInChildren<Animator>();
}
public void ChangeAnimatorState(BossAnimationState state)
{
print(gameObject.name + ",ChangeAnimatorState:" + state);
switch (state)
{
case BossAnimationState.LegSweep:
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", true);
animator.SetFloat("MoveSpeed", 0);
break;
case BossAnimationState.HurricaneKick:
animator.SetBool("HurricaneKick", true);
animator.SetBool("LegSweep", false);
animator.SetFloat("MoveSpeed", 0) ;
break;
case BossAnimationState.NotAttack:
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", false);
break;
default:
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", false);
Debug.LogError(state);
break;
}
}
}
fileFormatVersion: 2
guid: 17ab4b61d0b362349828e661a3b978a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -60,7 +60,7 @@ public class BossAttack : MonoBehaviour ...@@ -60,7 +60,7 @@ public class BossAttack : MonoBehaviour
public void ChangeAttackType(int i) public void ChangeAttackType(int i)
{ {
attackType = (AttackType)i; attackType = (AttackType)i;
//print("改变boss攻击状态为:"+attackType); print("改变boss攻击状态为:"+attackType);
} }
......
...@@ -7,6 +7,7 @@ public class BossMove : MonoBehaviour ...@@ -7,6 +7,7 @@ public class BossMove : MonoBehaviour
[Header("控制移动")] [Header("控制移动")]
[Tooltip("控制向前的速度。")] [Tooltip("控制向前的速度。")]
public float VSpeed = 10.0f; public float VSpeed = 10.0f;
[Header("生命和缩放")]
public int life = 30; public int life = 30;
private int MaxLife; private int MaxLife;
public float scale = 1; public float scale = 1;
...@@ -29,22 +30,50 @@ public class BossMove : MonoBehaviour ...@@ -29,22 +30,50 @@ public class BossMove : MonoBehaviour
private float timer = 0.0f; private float timer = 0.0f;
public GameObject BirthplacePos;//出生点 public GameObject BirthplacePos;//出生点
private BossAttack bossAttack; private BossAttack bossAttack;
[Header("附近敌人个数")]
public int EnemyNumber = 0; public int EnemyNumber = 0;
public float Timer1 = 5;
[Header("旋风腿")]
[Tooltip("旋风腿持续时间")]
public float HurricaneKickDuration = 3;
public float CurrentHurricaneKickDuration=0;
[Tooltip("旋风腿冷却时间")]
public float HurricaneKickCoolingTime =5;
public float CurrentHurricaneKickCoolingTime=0;
[Tooltip("旋风腿技能是否处于冷却中")]
public bool isDeltaTime = false; public bool isDeltaTime = false;
private bool isAttacking=false;
[Header("扫腿")]
[Tooltip("扫腿冷却时间")]
public float LegSweepDuration = 2;
public float CurrentLegSweepDuration = 0;
[Tooltip("扫腿技能是否处于冷却中")]
public bool isDeltaTime2 = false;
private bool LegSweepIsFinsh = false;
private bool HurricaneKickIsFinsh = false;
private bool IsCanRotate = true;
private bool IsCanMove = true;
private bool isHurricaneKick = false;
public enum BossState public enum BossState
{ {
Sleep=0, //睡着 Sleep=0, //睡着
GotoTarget=1, //朝着目标点移动 GotoTarget=1, //朝着目标点移动
GoBackToSleep=2 //返回碎觉点 GoBackToSleep=2, //返回碎觉点
LegSweep=3,
HurricaneKick=4,
Attack
} }
public BossState bossState= BossState.Sleep; public BossState bossState= BossState.Sleep;
private BossAnimationManager bossAnimationManager;
void Start() void Start()
...@@ -54,6 +83,10 @@ public class BossMove : MonoBehaviour ...@@ -54,6 +83,10 @@ public class BossMove : MonoBehaviour
//获取animator组件 //获取animator组件
animator = GetComponentInChildren<Animator>(); animator = GetComponentInChildren<Animator>();
bossAttack = GetComponentInChildren<BossAttack>(); bossAttack = GetComponentInChildren<BossAttack>();
bossAnimationManager = GetComponentInChildren<BossAnimationManager>();
} }
...@@ -106,15 +139,35 @@ public class BossMove : MonoBehaviour ...@@ -106,15 +139,35 @@ public class BossMove : MonoBehaviour
{ {
//print("游戏是否开始:"+ BattleCtrl.instance.isStartBattle); //print("游戏是否开始:"+ BattleCtrl.instance.isStartBattle);
//print("游戏是否结束:"+ BattleCtrl.instance.isEndBattle); //print("游戏是否结束:"+ BattleCtrl.instance.isEndBattle);
//----技能冷却--------------------------------------------------------------
if (isDeltaTime) if (isDeltaTime)
{ {
Timer1 += Time.deltaTime; //旋风腿处于冷却中
if (Timer1 > 5) CurrentHurricaneKickCoolingTime += Time.deltaTime;
if (CurrentHurricaneKickCoolingTime > HurricaneKickCoolingTime)
{ {
Timer1 = 5; //冷却完成,可以使用技能,重置技能持续时间。
CurrentHurricaneKickDuration = 0;
//重置冷却时间
CurrentHurricaneKickCoolingTime = 0;
//旋风腿退出冷却时间。
isDeltaTime = false; isDeltaTime = false;
} }
} }
if (isDeltaTime2)
{
//扫腿处于冷却中。
CurrentLegSweepDuration += Time.deltaTime;
if (CurrentLegSweepDuration >= LegSweepDuration)
{
CurrentLegSweepDuration = 0;
isDeltaTime2 = false;
}
}
//---------------------------------------------------------------------------
if (!BattleCtrl.instance.isStartBattle) if (!BattleCtrl.instance.isStartBattle)
{ {
return; return;
...@@ -132,9 +185,10 @@ public class BossMove : MonoBehaviour ...@@ -132,9 +185,10 @@ public class BossMove : MonoBehaviour
switch (bossState) switch (bossState)
{ {
case BossState.Sleep: case BossState.Sleep:
targetObj = null;
break; break;
case BossState.GotoTarget: case BossState.GotoTarget:
IsCanMove = true;
IsCanRotate = true;
timer += Time.deltaTime; timer += Time.deltaTime;
if (targetObj == null || timer >= 1) if (targetObj == null || timer >= 1)
{ {
...@@ -142,11 +196,92 @@ public class BossMove : MonoBehaviour ...@@ -142,11 +196,92 @@ public class BossMove : MonoBehaviour
timer = 0; timer = 0;
targetObj = GetTargetObj(); targetObj = GetTargetObj();
} }
animator.SetBool("LegSweep", false);
animator.SetBool("HurricaneKick", false);
//Boss目标为Player 或者 Competitor,追击目标
Vector3 speed = Vector3.zero;
Vector3 pos1 = new Vector3(transform.position.x, 0, transform.position.z);
Vector3 pos2 = new Vector3(targetObj.transform.position.x, 0, targetObj.transform.position.z);
speed = (pos2 - pos1).normalized * VSpeed;
xDelta = speed.x * Time.deltaTime;
zDelta = speed.z * Time.deltaTime;
if (Vector3.Distance(pos1, pos2) < 10f)
{
//敌人进入攻击范围
bossState = BossState.Attack;
}
break;
case BossState.Attack:
IsCanMove = false;
IsCanRotate = false;
//动画播放完成判断距离
LegSweepIsFinsh = !animator.GetCurrentAnimatorStateInfo(0).IsName("Leg Sweep");
HurricaneKickIsFinsh = !animator.GetCurrentAnimatorStateInfo(0).IsName("Hurricane Kick");
float dic = GetHorizontalDistance(transform.position, targetObj.transform.position);
if (LegSweepIsFinsh && HurricaneKickIsFinsh && dic >= 10)
{
//目标退出攻击范围
print("目标退出攻击范围");
bossState = BossState.GotoTarget;
}
if (EnemyNumber >= 2)
{
isHurricaneKick = true;
}
if (isHurricaneKick && !isDeltaTime && !animator.GetCurrentAnimatorStateInfo(0).IsName("Leg Sweep"))
{
//附近有2个人就触发,技能好了就等待,当前播放的动画不是扫腿就开始播放旋风腿。
print("旋风腿");
CurrentHurricaneKickDuration += Time.deltaTime;//旋风腿持续时间减少
if (CurrentHurricaneKickDuration >= HurricaneKickDuration)
{
//技能使用完成,进入冷却
isDeltaTime = true;
isHurricaneKick = false;
//重新计时冷却时间
CurrentHurricaneKickCoolingTime = 0;
CurrentHurricaneKickDuration = 0;
}
//HurricaneKickTime -= Time.deltaTime;
//if (HurricaneKickTime <= 0)
//{
// isDeltaTime = true; //旋转5秒等待5秒
// isHurricaneKick = false;
//}
bossAnimationManager.ChangeAnimatorState(BossAnimationState.HurricaneKick);
bossAttack.attackType = AttackType.HurricaneKick;
}
else if (dic < 10 && !isDeltaTime2)
{
print("扫腿");
IsCanRotate = true;
//注意的是,技能一开始使用,就进入了冷却计时。所以当前技能释放完成到下一次释放技能时间间隔会小于冷却时间。
isDeltaTime2 = true;
bossAnimationManager.ChangeAnimatorState(BossAnimationState.LegSweep);
bossAttack.attackType = AttackType.LegSweep;
}
else
{
print("追击目标");
bossAnimationManager.ChangeAnimatorState(BossAnimationState.NotAttack);
}
break; break;
case BossState.GoBackToSleep: case BossState.GoBackToSleep:
targetObj = BirthplacePos; targetObj = BirthplacePos;
if(Vector3.Distance(new Vector3(transform.position.x,0, transform.position.z), new Vector3(BirthplacePos.transform.position.x,0, BirthplacePos.transform.position.z)) < 0.2f) //Boss目标为出生点
speed = Vector3.zero;
pos1 = new Vector3(transform.position.x, 0, transform.position.z);
pos2 = new Vector3(targetObj.transform.position.x, 0, targetObj.transform.position.z);
speed = (pos2 - pos1).normalized * VSpeed;
xDelta = speed.x * Time.deltaTime;
zDelta = speed.z * Time.deltaTime;
if (Vector3.Distance(pos1, pos2) < 0.2f)
{ {
//boss回到出生点
bossState = BossState.Sleep; bossState = BossState.Sleep;
targetObj = null; targetObj = null;
} }
...@@ -154,8 +289,18 @@ public class BossMove : MonoBehaviour ...@@ -154,8 +289,18 @@ public class BossMove : MonoBehaviour
default:Debug.LogError(bossState); default:Debug.LogError(bossState);
break; break;
} }
if (targetObj != null) //控制移动
if (targetObj == null)
{ {
xDelta = 0;
zDelta = 0;
}
if (targetObj!= null&&IsCanRotate)
{
//是否可以旋转
print("Boss旋转");
Vector3 speed = Vector3.zero; Vector3 speed = Vector3.zero;
Vector3 pos1 = new Vector3(transform.position.x, 0, transform.position.z); Vector3 pos1 = new Vector3(transform.position.x, 0, transform.position.z);
Vector3 pos2 = new Vector3(targetObj.transform.position.x, 0, targetObj.transform.position.z); Vector3 pos2 = new Vector3(targetObj.transform.position.x, 0, targetObj.transform.position.z);
...@@ -163,79 +308,58 @@ public class BossMove : MonoBehaviour ...@@ -163,79 +308,58 @@ public class BossMove : MonoBehaviour
xDelta = speed.x * Time.deltaTime; xDelta = speed.x * Time.deltaTime;
zDelta = speed.z * Time.deltaTime; zDelta = speed.z * Time.deltaTime;
if (Vector3.Distance(pos1, pos2) < 10f)
{
//print("boss附近敌人个数:"+ EnemyNumber+"技能是否不能使用:"+ isDeltaTime);
if (EnemyNumber >= 2&& !isDeltaTime)
{
Timer1 -= Time.deltaTime;
if (Timer1 <= 0) isDeltaTime = true; //旋转5秒等待5秒
//print("11111111111111");
animator.SetBool("HurricaneKick", true);
animator.SetBool("LegSweep", false);
bossAttack.attackType = AttackType.HurricaneKick;
}
else
{
//print("2222222222222");
isAttacking = true;
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", true);
bossAttack.attackType = AttackType.LegSweep;
}
}
else
{
isAttacking = false;
animator.SetBool("LegSweep", false);
animator.SetBool("HurricaneKick", false);
//bossAttack.attackType = AttackType.Null;
}
}
else
{
xDelta = 0;
zDelta = 0;
}
Move();
}
public void Move()
{
float angle = Vector3.Angle(Vector3.forward, new Vector3(xDelta, 0, zDelta)); float angle = Vector3.Angle(Vector3.forward, new Vector3(xDelta, 0, zDelta));
if (xDelta < 0) if (xDelta < 0)
{ {
angle = -Mathf.Abs(angle); angle = -Mathf.Abs(angle);
} }
transform.localEulerAngles = new Vector3(0, angle, 0); transform.localEulerAngles = new Vector3(0, angle, 0);
if (isAttacking)
{
} }
else if (IsCanMove)
{ {
//print("isAttacking:" + isAttacking+"Boss开始移动:" + new Vector3(xDelta, yDelta, zDelta)); //是否可以移动
characterController.Move(new Vector3(xDelta, yDelta, zDelta));//移动 characterController.Move(new Vector3(xDelta, yDelta, zDelta));//移动
} }
//移动 //移动
MoveSpeed = new Vector3(xDelta,0,zDelta).magnitude; MoveSpeed = new Vector3(xDelta / Time.deltaTime, 0, zDelta / Time.deltaTime).magnitude;
//是否在地面 //是否在地面
Grounded = characterController.isGrounded; Grounded = characterController.isGrounded;
animator.SetFloat("MoveSpeed", MoveSpeed); animator.SetFloat("MoveSpeed", MoveSpeed);
animator.SetBool("Grounded", Grounded); animator.SetBool("Grounded", Grounded);
} }
public string GetCurrentAnimatorName()
{
string name=null;
List<string> names = new List<string>() { "Leg Sweep", "Hurricane Kick", "Idle", "Idle2", "Running" };
foreach (string item in names)
{
if (animator.GetCurrentAnimatorStateInfo(0).IsName(item))
{
name = item;
return name;
}
}
Debug.LogError("Boss没有动画状态。");
return name;
}
/// <summary>
/// 获取pos1和pos2的水平距离
/// </summary>
/// <param name="pos1"></param>
/// <param name="pos2"></param>
/// <returns></returns>
public float GetHorizontalDistance(Vector3 pos1, Vector3 pos2)
{
float dic;
pos1 = new Vector3(pos1.x, 0, pos1.z);
pos2 = new Vector3(pos2.x, 0, pos2.z);
dic = Vector3.Distance(pos1, pos2);
return dic;
}
//唤醒boss //唤醒boss
public void AwakeBoss(GameObject obj) public void AwakeBoss(GameObject obj)
......
...@@ -104,10 +104,10 @@ public class PlayerMove : MonoBehaviour ...@@ -104,10 +104,10 @@ public class PlayerMove : MonoBehaviour
{ {
if (hit.gameObject== targetWall) if (hit.gameObject== targetWall)
{ {
print("Player碰到墙:"+ scale); //print("Player碰到墙:"+ scale);
if (scale>1) if (scale>1)
{ {
print("推墙"); //print("推墙");
hit.gameObject.GetComponent<Rigidbody>().AddForce(new Vector3(0, 0, 100)); hit.gameObject.GetComponent<Rigidbody>().AddForce(new Vector3(0, 0, 100));
scale -= reduceStep; scale -= reduceStep;
ReduceIsPlayChangeModeEffect(); ReduceIsPlayChangeModeEffect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment