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 --- .../PC/Erika/AnimationData/Air_Combo03_Z0_1.asset | 5 +- .../PC/Erika/AnimationData/Air_Combo03_Z0_2.asset | 4 +- .../PC/Erika/AnimationData/Air_Combo03_Z0_3.asset | 5 +- .../PC/Erika/AnimationData/Air_Combo03_Z0_4.asset | 6 ++- .../PC/Erika/AnimationData/Air_Combo03_Z0_5.asset | 3 +- .../Erika/AnimationData/Attack_Jump_to_Air.asset | 3 +- .../Unit/PC/Erika/Prefabs/Erika_Robot.prefab | 4 +- Assets/Scripts/Input/InputManager.cs | 59 +++++++++++++--------- Assets/Scripts/Unit/AnimationData.cs | 1 + Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs | 4 +- .../Scripts/Unit/Components/UnitState/PCState.cs | 13 +++-- Assets/Scripts/Unit/Controller/PCController.cs | 2 + 12 files changed, 70 insertions(+), 39 deletions(-) (limited to 'Assets') diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_1.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_1.asset index 323a0783..cae0b6e4 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_1.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_1.asset @@ -31,6 +31,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: Assets/Art/Vfx/Hit & Slashes Vol.3/Prefabs/hit-line-1.prefab @@ -113,7 +114,7 @@ MonoBehaviour: toggles: m_keys: 00000000 m_values: - - from: 0.3 + - from: 0.35 to: 1 parameters: m_keys: @@ -140,7 +141,7 @@ MonoBehaviour: bone: position: {x: 0, y: 0.8, z: 0} rotation: {x: -24.814, y: 33.032, z: -30.331} - scale: {x: 0.6, y: 0.6, z: 0.6} + scale: {x: 0.7, y: 0.7, z: 0.7} --- !u!114 &114480333145456874 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_2.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_2.asset index 18616499..19125755 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_2.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_2.asset @@ -29,6 +29,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: @@ -67,6 +68,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: Assets/Art/Vfx/Hit & Slashes Vol.3/Prefabs/hit-line-1.prefab @@ -180,4 +182,4 @@ MonoBehaviour: bone: position: {x: 0, y: 0.8, z: 0} rotation: {x: 16.405, y: -122.817, z: 27.753} - scale: {x: 0.6, y: 0.6, z: 0.6} + scale: {x: 0.7, y: 0.7, z: 0.7} diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_3.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_3.asset index 1e4c20b5..5f4f3c83 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_3.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_3.asset @@ -30,6 +30,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: Assets/Art/Vfx/Hit & Slashes Vol.3/Prefabs/hit-line-1.prefab @@ -120,7 +121,7 @@ MonoBehaviour: toggles: m_keys: 00000000 m_values: - - from: 0.3 + - from: 0.4 to: 1 parameters: m_keys: @@ -147,4 +148,4 @@ MonoBehaviour: bone: position: {x: 0, y: 1.2, z: 0} rotation: {x: -85.16, y: 0, z: 0} - scale: {x: 0.6, y: 0.6, z: 0.6} + scale: {x: 0.7, y: 0.7, z: 0.7} diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_4.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_4.asset index 35ad051a..5ef74246 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_4.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_4.asset @@ -29,6 +29,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: @@ -75,6 +76,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: Assets/Art/Vfx/Hit & Slashes Vol.3/Prefabs/hit-line-1.prefab @@ -188,7 +190,7 @@ MonoBehaviour: toggles: m_keys: 00000000 m_values: - - from: 0.45 + - from: 0.5 to: 1 parameters: m_keys: @@ -216,4 +218,4 @@ MonoBehaviour: bone: position: {x: 0, y: 0.3, z: 0} rotation: {x: 30.204, y: 15.196, z: -14.663} - scale: {x: 0.6, y: 0.6, z: 0.6} + scale: {x: 0.7, y: 0.7, z: 0.7} diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_5.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_5.asset index cf4c4953..3ea37260 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_5.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Air_Combo03_Z0_5.asset @@ -30,6 +30,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: Assets/Art/Vfx/Hit & Slashes Vol.3/Prefabs/hit-line-1.prefab @@ -130,4 +131,4 @@ MonoBehaviour: bone: position: {x: 0, y: 1.7, z: 0} rotation: {x: -416.096, y: 90.00001, z: 270} - scale: {x: 0.6, y: 0.6, z: -0.6} + scale: {x: 0.7, y: 0.7, z: -0.7} diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Attack_Jump_to_Air.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Attack_Jump_to_Air.asset index 54dd0273..6570f37a 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Attack_Jump_to_Air.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Attack_Jump_to_Air.asset @@ -30,6 +30,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + freezeGlobal: 0 freezeFramesSelf: 0 freezeFramesOther: 0 sparkPath: @@ -99,7 +100,7 @@ MonoBehaviour: toggles: m_keys: 00000000 m_values: - - from: 0.2 + - from: 0.25 to: 1 parameters: m_keys: diff --git a/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab b/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab index c5b0e838..4cf8a46c 100644 --- a/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab +++ b/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab @@ -58,8 +58,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1357685695} m_LocalRotation: {x: -0.24720925, y: -0.40268856, z: 0.18871981, w: -0.86088} - m_LocalPosition: {x: 0.198, y: -0.172, z: 0.244} - m_LocalScale: {x: 0.01006957, y: 0.014763792, z: 1.1182132} + m_LocalPosition: {x: 0.1611, y: -0.1365, z: 0.21} + m_LocalScale: {x: 0.01006957, y: 0.014763792, z: 0.9952188} m_Children: - {fileID: 2135912540} - {fileID: 332159091} diff --git a/Assets/Scripts/Input/InputManager.cs b/Assets/Scripts/Input/InputManager.cs index 4ad6ec02..6b200462 100644 --- a/Assets/Scripts/Input/InputManager.cs +++ b/Assets/Scripts/Input/InputManager.cs @@ -59,30 +59,41 @@ public class InputManager : SingletonMB public bool TryCommand(float interval = 0.5f, params KeyCode[] keys) { - if (keys.Length > m_CommandQueue.Count) - return false; - if (!Input.GetKey(keys[keys.Length - 1])) + return TryCommand(interval, true, keys); + + } + + public bool TryCommand(float interval = 0.5f, bool checkInput = false, params KeyCode[] keys) + { + if (keys.Length > m_CommandQueue.Count) return false; - int count = m_CommandQueue.Count; - float preTime = m_CommandQueue[count - keys.Length].time; - for (int i = 0; i < keys.Length; ++i) - { - if(keys[i] == m_CommandQueue[i + count - keys.Length].key) - { - if(m_CommandQueue[i + count - keys.Length].time - preTime > interval) - { - return false; - } - preTime = m_CommandQueue[i + count - keys.Length].time; - } - else - { - return false; - } - } - //m_CommandQueue.RemoveRange(count - keys.Length, keys.Length); - m_CommandQueue.Clear(); - return true; - } + if (checkInput && !Input.GetKey(keys[keys.Length - 1])) + return false; + int count = m_CommandQueue.Count; + float preTime = m_CommandQueue[count - keys.Length].time; + for (int i = 0; i < keys.Length; ++i) + { + if (keys[i] == m_CommandQueue[i + count - keys.Length].key) + { + if (m_CommandQueue[i + count - keys.Length].time - preTime > interval) + { + return false; + } + preTime = m_CommandQueue[i + count - keys.Length].time; + } + else + { + return false; + } + } + //m_CommandQueue.RemoveRange(count - keys.Length, keys.Length); + m_CommandQueue.Clear(); // 清理 + return true; + } + + public void ClearCommand() + { + m_CommandQueue.Clear(); + } } diff --git a/Assets/Scripts/Unit/AnimationData.cs b/Assets/Scripts/Unit/AnimationData.cs index ead0f16d..b4907239 100644 --- a/Assets/Scripts/Unit/AnimationData.cs +++ b/Assets/Scripts/Unit/AnimationData.cs @@ -81,6 +81,7 @@ public enum EAnimationProperty ComboTimeOffset = 1, IgnoreY = 2, TransitionInDuration = 3, + } [Serializable] diff --git a/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs b/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs index b765265c..9f1d629a 100644 --- a/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs +++ b/Assets/Scripts/Unit/Collider/ColliderBox_Hitbox.cs @@ -62,7 +62,9 @@ public partial class ColliderBox [Comment("[ 击中效果 ]", TextAnchor.MiddleCenter)] - [Foldout("时间效果", 2)] + [Foldout("时间效果", 3)] + [Tooltip("全局顿帧")] + public float freezeGlobal; [Tooltip("自身顿帧")] public float freezeFramesSelf; //[WhenNot("freezeFramesSelf", 0)] 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) { diff --git a/Assets/Scripts/Unit/Controller/PCController.cs b/Assets/Scripts/Unit/Controller/PCController.cs index 851fb80a..2294ae62 100644 --- a/Assets/Scripts/Unit/Controller/PCController.cs +++ b/Assets/Scripts/Unit/Controller/PCController.cs @@ -39,6 +39,8 @@ public class PCController : UnitController public override void OnHit(CollisionInfo info) { + ColliderBox hitbox = info.collider.colliderInfo.collider; + Debug.Assert(hitbox.type == ColliderBox.EColliderType.HitBox); } public override void OnGetHit(CollisionInfo info) -- cgit v1.1-26-g67d0