diff options
author | chai <chaifix@163.com> | 2020-11-17 21:16:39 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-11-17 21:16:39 +0800 |
commit | 71b23799b537869e2bd7ca5f070f65fdd22114a9 (patch) | |
tree | a49f1c53aa6dcfdf73a92cecddc8cc0306500758 /Assets/Scripts | |
parent | 01f06fb513dab303abeb02d7e1007e397874bcc0 (diff) |
*misc
Diffstat (limited to 'Assets/Scripts')
-rw-r--r-- | Assets/Scripts/Avatar/States/AttackState.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Assets/Scripts/Avatar/States/AttackState.cs b/Assets/Scripts/Avatar/States/AttackState.cs index ae8f3b66..18a20115 100644 --- a/Assets/Scripts/Avatar/States/AttackState.cs +++ b/Assets/Scripts/Avatar/States/AttackState.cs @@ -8,6 +8,7 @@ public struct AttackStateConfig public int motion; public Animator animator; public PhysicsBody body; + public float crossFade; } // 单独的一个招式 @@ -48,12 +49,13 @@ public class AttackState : StateBase } - public AttackState(Animator animator, int animation, PhysicsBody body = null) + public AttackState(Animator animator, int animation, PhysicsBody body = null, float crossFade = 0f) { m_Config.animator = animator; m_Config.motion = animation; m_Config.velocity = Vector3.zero; m_Config.body = body; + m_Config.crossFade = crossFade; } public AttackState(AttackStateConfig config) @@ -74,7 +76,7 @@ public class AttackState : StateBase { m_TimeCount = 0; - m_Config.animator.CrossFade(m_Config.motion, 0); + m_Config.animator.CrossFade(m_Config.motion, m_Config.crossFade); if(m_Config.body != null) { |