diff options
author | chai <chaifix@163.com> | 2020-10-17 15:39:34 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-17 15:39:34 +0800 |
commit | fee35151213939d61d2dbd9d6a0ba71ac93b91cf (patch) | |
tree | 3aa986e27f36e47242b9a12b7e7b6a8d5d8c0fc8 /Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs | |
parent | f99c4d56cf95c563e95d3965ffd6d8ba33b660ee (diff) |
+ 连击测试
Diffstat (limited to 'Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs')
-rw-r--r-- | Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs b/Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs index 2c39afd5..eadee433 100644 --- a/Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs +++ b/Assets/Scripts/AbilitySystem/Abilities/MoveAbility.cs @@ -4,11 +4,19 @@ using UnityEngine; public class MoveAbility : AbilityBase
{
+ Animator m_Animator;
+ int m_AnimHash;
/// <summary>
/// 在跑动状态时可以切换的ability
/// </summary>
- private List<Trigger> m_Triggers;
+ private List<Trigger> m_Triggers = new List<Trigger>();
+
+ public MoveAbility(Animator animator, int animation)
+ {
+ m_Animator = animator;
+ m_AnimHash = animation;
+ }
public override void OnInit()
{
@@ -22,7 +30,7 @@ public class MoveAbility : AbilityBase public override void OnEnter()
{
-
+ m_Animator.CrossFade(m_AnimHash, 0);
}
public override void OnExit()
@@ -31,7 +39,6 @@ public class MoveAbility : AbilityBase public override void OnHit()
{
- throw new System.NotImplementedException();
}
public override void OnHurt()
@@ -40,7 +47,6 @@ public class MoveAbility : AbilityBase public override void OnTranslate(AbilityBase to)
{
- throw new System.NotImplementedException();
}
public override void OnUpdate()
@@ -51,4 +57,12 @@ public class MoveAbility : AbilityBase break;
}
}
+
+ public void AddTrigger(Trigger trigger)
+ {
+ if (trigger == null || m_Triggers.Contains(trigger))
+ return;
+ m_Triggers.Add(trigger);
+ }
+
}
|