From 781ad1b41d10e1ff828eb8e4ca60648fdd224cd0 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 9 Sep 2021 16:19:47 +0800 Subject: =?UTF-8?q?*=E8=B0=83=E6=95=B4=E5=87=A0=E4=B8=AA=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Unit/Components/UnitState/PCState.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 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 b8512d64..c332dcda 100644 --- a/Assets/Scripts/Unit/Components/UnitState/PCState.cs +++ b/Assets/Scripts/Unit/Components/UnitState/PCState.cs @@ -278,12 +278,14 @@ public class PCState : UnitState { m_Owner.pcAnimation.AnimAttackToAir(param.offset); yield return null; + InputManager.Instance.ClearCommand(); while (true) { bool canCombo = m_Owner.pcAnimation.baseLayer.IsToggleOpen(EAnimationToogle.Combo); if(canCombo) { - if(Input.GetKeyDown("j")) + //if(Input.GetKeyDown("j")) + if(InputManager.Instance.TryCommand(0.5f, false, KeyCode.J)) { ChangeState(EUnitState.AirAttack, new SkillParam()); } @@ -308,10 +310,11 @@ public class PCState : UnitState IEnumerator AirAttack(SkillParam param) { - int total = 5; + int total = 5; int id = 0; m_Owner.pcAnimation.AnimAirAttack(id++); yield return null; // 等待animator更新 + InputManager.Instance.ClearCommand(); while (true) { bool canCombo = m_Owner.pcAnimation.baseLayer.IsToggleOpen(EAnimationToogle.Combo); @@ -328,7 +331,7 @@ public class PCState : UnitState ChangeState(EUnitState.AirDash, new AirDashParam()); } - if (Input.GetKeyDown("j")) + if (InputManager.Instance.TryCommand(0.3f, false, KeyCode.J)) { if (Input.GetKey("a")) { @@ -477,6 +480,10 @@ public class PCState : UnitState TurnAround(true); pos.x += vz * Time.deltaTime; } + if(Input.GetKeyDown("j")) + { + ChangeState(EUnitState.AirAttack, new SkillParam()); + } m_Owner.transform.position = pos; if (pos.y > 0 && pos.y <= 1 && !landingGround) { -- cgit v1.1-26-g67d0