summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/Components/UnitState/PCState.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-08 19:18:57 +0800
committerchai <chaifix@163.com>2021-09-08 19:18:57 +0800
commit2fa67922f08ef39b4d70bad001592aedf22c9018 (patch)
tree5945b091a2651b8350760bdf532e93fcddc96016 /Assets/Scripts/Unit/Components/UnitState/PCState.cs
parent55d289f8eff1af2d2a2ff02c878faa354dcf6c91 (diff)
*misc
Diffstat (limited to 'Assets/Scripts/Unit/Components/UnitState/PCState.cs')
-rw-r--r--Assets/Scripts/Unit/Components/UnitState/PCState.cs64
1 files changed, 56 insertions, 8 deletions
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;