summaryrefslogtreecommitdiff
path: root/Assets/Scripts
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-17 21:16:39 +0800
committerchai <chaifix@163.com>2020-11-17 21:16:39 +0800
commit71b23799b537869e2bd7ca5f070f65fdd22114a9 (patch)
treea49f1c53aa6dcfdf73a92cecddc8cc0306500758 /Assets/Scripts
parent01f06fb513dab303abeb02d7e1007e397874bcc0 (diff)
*misc
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Avatar/States/AttackState.cs6
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)
{