From 86ec4522be1d0b932006801c7bf2297adc9f0028 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 30 Aug 2021 21:11:54 +0800 Subject: *misc --- Assets/Scripts/Unit/Component/MonsterState.cs | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'Assets/Scripts/Unit/Component/MonsterState.cs') diff --git a/Assets/Scripts/Unit/Component/MonsterState.cs b/Assets/Scripts/Unit/Component/MonsterState.cs index b1ff9cbd..cd2ed8e5 100644 --- a/Assets/Scripts/Unit/Component/MonsterState.cs +++ b/Assets/Scripts/Unit/Component/MonsterState.cs @@ -76,6 +76,10 @@ public class MonsterState : UnitState public struct HitLightParam { } + public struct HitAirParam { } + + public struct RiseParam { } + #region Idle IEnumerator Idle(IdleParam param) @@ -121,6 +125,54 @@ public class MonsterState : UnitState { } + #endregion + + #region HitAir + + IEnumerator HitAir(HitAirParam param) + { + m_Owner.monsterAnimation.AnimHitAir(); + yield return null; + while (true) + { + bool reachEnd = m_Owner.monsterAnimation.layers[0].playbackNomralizedTime == 1; + if (reachEnd) + { + //yield return new WaitForSeconds(1f); + ChangeState(EUnitState.Rise, new RiseParam()); + } + yield return null; + } + } + + void OnHitAirExit(EUnitState nextState) + { + } + + #endregion + + #region Rise + + IEnumerator Rise(RiseParam param) + { + m_Owner.monsterAnimation.AnimRise(); + yield return null; + while (true) + { + bool reachEnd = m_Owner.monsterAnimation.layers[0].playbackNomralizedTime == 1; + if (reachEnd) + { + ChangeState(EUnitState.Idle, new IdleParam()); + } + yield return null; + } + } + + void OnRiseExit(EUnitState nextState) + { + } + + #endregion -- cgit v1.1-26-g67d0