2022-12-27 13:12:53 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-12-28 14:10:45 +02:00
|
|
|
public class BlockState : BlockParentState
|
2022-12-27 13:12:53 +02:00
|
|
|
{
|
2022-12-28 14:10:45 +02:00
|
|
|
public override void UpdateLogic(PlayerNetwork player)
|
2022-12-27 13:12:53 +02:00
|
|
|
{
|
2022-12-28 14:10:45 +02:00
|
|
|
base.UpdateLogic(player);
|
|
|
|
|
player.animation = "Block";
|
|
|
|
|
player.animationFrames++;
|
2023-07-02 23:17:37 +03:00
|
|
|
player.velocity = new DemonVector2(player.velocity.x, 0);
|
2022-12-28 14:10:45 +02:00
|
|
|
ToIdleState(player);
|
2022-12-27 13:12:53 +02:00
|
|
|
}
|
2022-12-28 14:10:45 +02:00
|
|
|
private void ToIdleState(PlayerNetwork player)
|
2022-12-27 13:12:53 +02:00
|
|
|
{
|
2022-12-28 14:10:45 +02:00
|
|
|
if (player.stunFrames <= 0)
|
|
|
|
|
{
|
|
|
|
|
BlockParentState.skipKnockback = false;
|
|
|
|
|
player.player.StopShakeCoroutine();
|
2023-04-27 11:32:47 +03:00
|
|
|
CheckTrainingComboEnd(player);
|
2023-01-23 18:31:58 +02:00
|
|
|
EnterState(player, "Idle");
|
2022-12-28 14:10:45 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
protected override void OnEnter(PlayerNetwork player)
|
|
|
|
|
{
|
|
|
|
|
base.OnEnter(player);
|
2022-12-27 13:12:53 +02:00
|
|
|
}
|
|
|
|
|
}
|