Skip to content

Commit

Permalink
添加失败时败方僵直动画
Browse files Browse the repository at this point in the history
moshuying committed Jul 7, 2024
1 parent 399c6f1 commit be50220
Showing 2 changed files with 76 additions and 9 deletions.
79 changes: 70 additions & 9 deletions Assets/Animations/LocoMotion.controller
Original file line number Diff line number Diff line change
@@ -14,6 +14,57 @@ AnimatorTransition:
m_Mute: 0
m_IsExit: 0
serializedVersion: 1
--- !u!1102 &-3531111895592773006
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: fail
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: 6ce56cad2f1fde340a0d2f90218afca2, type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-784291752273302855
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: fail
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -3531111895592773006}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.6875
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@@ -28,49 +79,55 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: run
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: speed
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: angle
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: walk
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: turn
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: gr
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: jump
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: fail
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@@ -503,6 +560,7 @@ AnimatorState:
m_Transitions:
- {fileID: 1101666688176370768}
- {fileID: 1101438138968196784}
- {fileID: -784291752273302855}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@@ -804,6 +862,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: 1102214512872333120}
m_Position: {x: 192, y: -156, z: 0}
- serializedVersion: 1
m_State: {fileID: -3531111895592773006}
m_Position: {x: 800, y: 180, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions:
@@ -812,6 +873,6 @@ AnimatorStateMachine:
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ExitPosition: {x: 870, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102051169147150922}
6 changes: 6 additions & 0 deletions Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
@@ -166,10 +166,16 @@ public void OnPlayerJointBreak(float breakForce)
{
// 箱子断开,游戏结束
endGame();
// 失败方播放失败动画
animator.SetBool("fail", true);
}

private void OnTriggerEnter(Collider other)
{
if (disableUserInput)
{
return;
}
if (other.gameObject.tag == "Crate")
{
GameObject.Destroy(other.gameObject);

0 comments on commit be50220

Please sign in to comment.