|
|
@@ -38,6 +38,7 @@ public class chargeDownward : MonoBehaviour
|
|
|
[LabelText("能否冲刺")]
|
|
|
public bool canDash = true;
|
|
|
public bool isFind = true;
|
|
|
+ public bool isBreakEnd = false;
|
|
|
|
|
|
[LabelText("是否使用本地坐标")]
|
|
|
public bool useLocalSpace = true;
|
|
|
@@ -76,10 +77,11 @@ public class chargeDownward : MonoBehaviour
|
|
|
{
|
|
|
if (owner.state != CharacterState.Attack)
|
|
|
{
|
|
|
- if (owner.state != CharacterState.FramePause || owner.state != CharacterState.HitStun)
|
|
|
+ if (owner.state != CharacterState.FramePause && owner.state != CharacterState.HitStun && owner.state != CharacterState.Idle)
|
|
|
{
|
|
|
canDash = true;
|
|
|
IsDashing = false;
|
|
|
+ isBreakEnd = false;
|
|
|
isBreaking = false;
|
|
|
IsRising = false;
|
|
|
isFind = true;
|
|
|
@@ -97,6 +99,7 @@ public class chargeDownward : MonoBehaviour
|
|
|
{
|
|
|
foot.SetActive(true);
|
|
|
}
|
|
|
+ currentState = MovementState.Idle;
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
@@ -116,7 +119,11 @@ public class chargeDownward : MonoBehaviour
|
|
|
StartDash();
|
|
|
currentState = MovementState.Dashing;
|
|
|
}
|
|
|
- else if (!canDash && !attackController.isAttackTriggerOn && !isBreaking)
|
|
|
+ else if (!canDash && !attackController.isAttackTriggerOn && !isBreakEnd)
|
|
|
+ {
|
|
|
+ currentState = MovementState.Breaking;
|
|
|
+ }
|
|
|
+ else if (!canDash && !attackController.isAttackTriggerOn && !isBreaking && isBreakEnd)
|
|
|
{
|
|
|
StartRise();
|
|
|
currentState = MovementState.Rising;
|
|
|
@@ -198,7 +205,6 @@ public class chargeDownward : MonoBehaviour
|
|
|
public void StartRise()
|
|
|
{
|
|
|
if (IsRising || isBreaking) return;
|
|
|
-
|
|
|
riseStartPosition = transform.position; // 记录上升起点
|
|
|
IsRising = true;
|
|
|
owner.ani.Play("idle", 0, 0);
|
|
|
@@ -219,6 +225,7 @@ public class chargeDownward : MonoBehaviour
|
|
|
{
|
|
|
IsRising = false;
|
|
|
canDash = true;
|
|
|
+ isBreakEnd = false;
|
|
|
currentState = MovementState.Idle;
|
|
|
owner.ChangeState(CharacterState.Idle);
|
|
|
foot.GetComponent<Foot>().trigGroundList.Clear();
|
|
|
@@ -247,6 +254,7 @@ public class chargeDownward : MonoBehaviour
|
|
|
if (Time.time - breakEndStartTime >= breakEndDuration && !isBreaking)
|
|
|
{
|
|
|
currentState = MovementState.Idle;
|
|
|
+ isBreakEnd = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -294,7 +302,7 @@ public class chargeDownward : MonoBehaviour
|
|
|
public bool IsDashing { get; private set; }
|
|
|
public bool IsRising { get; private set; }
|
|
|
[ShowInInspector, ReadOnly]
|
|
|
- private bool isBreaking;
|
|
|
+ public bool isBreaking;
|
|
|
|
|
|
public BeSearchTrigger FindClosestTriggerByX(float selfX)
|
|
|
{
|