Files
Darklings-FightingGame/Assets/_Project/Scripts/SimulationScripts/StateScripts/StatesScripts/ExceptionStateScripts/KnockdownSoftState.cs
2023-04-01 22:50:26 +03:00

32 lines
882 B
C#

using Demonics;
public class KnockdownSoftState : State
{
public override void UpdateLogic(PlayerNetwork player)
{
CheckFlip(player);
if (player.enter)
{
player.animationFrames++;
}
if (!player.enter)
{
player.player.PlayerUI.DisplayNotification(NotificationTypeEnum.SoftKnockdown);
player.enter = true;
player.animationFrames = 0;
player.sound = "Landed";
player.SetEffect("Fall", player.position);
}
player.framedataEnum = FramedataTypesEnum.Knockdown;
player.hurtbox.active = false;
player.animation = "Knockdown";
ToIdleState(player);
}
private void ToIdleState(PlayerNetwork player)
{
if (player.animationFrames >= 30)
{
EnterState(player, "WakeUp");
}
}
}