Files

30 lines
767 B
C#
Raw Normal View History

2022-12-27 13:12:53 +02:00
using UnityEngine;
2022-12-28 14:10:45 +02:00
public class BlockLowState : 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);
2023-01-19 17:07:46 +02:00
player.position = new DemonicsVector2(player.position.x, DemonicsPhysics.GROUND_POINT);
2022-12-28 14:10:45 +02:00
player.animation = "BlockLow";
player.animationFrames++;
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)
{
player.player.StopShakeCoroutine();
player.enter = false;
2023-01-13 15:28:18 +02:00
if (player.direction.y < 0)
{
player.state = "Crouch";
}
else
{
player.state = "Idle";
}
2022-12-28 14:10:45 +02:00
}
}
2022-12-27 13:12:53 +02:00
}