You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
31 lines
819 B
C#
31 lines
819 B
C#
using UnityEngine;
|
|
|
|
public class CrouchState : GroundParentState
|
|
{
|
|
public override void UpdateLogic(PlayerNetwork player)
|
|
{
|
|
if (!player.enter)
|
|
{
|
|
player.enter = true;
|
|
player.animation = "Crouch";
|
|
player.animationFrames = 0;
|
|
return;
|
|
}
|
|
player.position = new DemonicsVector2(player.position.x, DemonicsPhysics.GROUND_POINT);
|
|
CheckFlip(player);
|
|
player.canDoubleJump = true;
|
|
player.dashFrames = 0;
|
|
player.animationFrames = 0;
|
|
player.velocity = DemonicsVector2.Zero;
|
|
base.UpdateLogic(player);
|
|
ToIdleState(player);
|
|
}
|
|
|
|
private void ToIdleState(PlayerNetwork player)
|
|
{
|
|
if (player.direction.y >= 0)
|
|
{
|
|
EnterState(player, "Idle");
|
|
}
|
|
}
|
|
} |