From 2fa67922f08ef39b4d70bad001592aedf22c9018 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 8 Sep 2021 19:18:57 +0800 Subject: *misc --- .../Scripts/Unit/Components/UnitState/PCState.cs | 64 +++++++++++++++++++--- 1 file changed, 56 insertions(+), 8 deletions(-) (limited to 'Assets/Scripts/Unit/Components/UnitState/PCState.cs') diff --git a/Assets/Scripts/Unit/Components/UnitState/PCState.cs b/Assets/Scripts/Unit/Components/UnitState/PCState.cs index e448b6b2..c8937895 100644 --- a/Assets/Scripts/Unit/Components/UnitState/PCState.cs +++ b/Assets/Scripts/Unit/Components/UnitState/PCState.cs @@ -20,6 +20,7 @@ public class PCState : UnitState // Attack, AirAttack, + AttackToAir, AirDash, // HitAir, @@ -66,7 +67,7 @@ public class PCState : UnitState public struct SkillParam { - + public float offset; } public struct AirDashParam @@ -153,7 +154,11 @@ public class PCState : UnitState { ChangeState(EUnitState.Attack, new SkillParam()); } - if (Input.GetKeyDown("space")) + if(Input.GetKeyDown("u")) + { + ChangeState(EUnitState.AttackToAir, new SkillParam()); + } + if (Input.GetKeyDown("space")) { ChangeState(EUnitState.Jump, new JumpParam()); } @@ -221,8 +226,19 @@ public class PCState : UnitState yield return null; while (true) { - bool canCombo = m_Owner.pcAnimation.baseLayer.IsToggleOpen(EAnimationToogle.Combo); - if (canCombo && id < total) + bool canCombo = m_Owner.pcAnimation.baseLayer.IsToggleOpen(EAnimationToogle.Combo); + if (canCombo) + { + //if (InputManager.Instance.TryCommand(0.5f, KeyCode.W, KeyCode.J)) + if (Input.GetKeyDown("u")) + { + SkillParam skill = new SkillParam(); + skill.offset = 0.12f; + ChangeState(EUnitState.AttackToAir, skill); + } + } + + if (canCombo && id < total) { if (Input.GetKeyDown("j")) { @@ -252,12 +268,44 @@ public class PCState : UnitState void OnAttackExit(EUnitState next) { - } - + } + #endregion - + + #region AttackToAir + + IEnumerator AttackToAir(SkillParam param) + { + m_Owner.pcAnimation.AnimAttackToAir(param.offset); + yield return null; + while (true) + { + bool canCombo = m_Owner.pcAnimation.baseLayer.IsToggleOpen(EAnimationToogle.Combo); + if(canCombo) + { + if(Input.GetKeyDown("j")) + { + ChangeState(EUnitState.AirAttack, new SkillParam()); + } + } + + bool reachEnd = m_Owner.pcAnimation.baseLayer.playbackNormalizedTime == 1; + if (reachEnd) + { + ChangeState(EUnitState.Landing, new LandingParam()); + } + yield return null; + } + } + + void OnAttackToAirExit() + { + } + + #endregion + #region AirAttack - + IEnumerator AirAttack(SkillParam param) { int id = 0; -- cgit v1.1-26-g67d0