Files

32 lines
860 B
C#
Raw Normal View History

2023-01-02 19:59:46 +02:00
using UnityEngine;
public class TauntState : State
{
public override void UpdateLogic(PlayerNetwork player)
{
CheckFlip(player);
2023-01-02 19:59:46 +02:00
if (!player.enter)
{
2023-01-28 16:02:34 +02:00
if (player.otherPlayer.health <= 0)
player.comboLocked = true;
else
player.comboLocked = false;
2023-01-02 19:59:46 +02:00
player.enter = true;
player.animationFrames = 0;
player.animation = "Taunt";
}
2023-07-02 23:17:37 +03:00
player.velocity = DemonVector2.Zero;
2023-01-02 19:59:46 +02:00
player.animationFrames++;
if (GameSimulation.Timer <= 0)
return;
2023-01-02 19:59:46 +02:00
ToIdleState(player);
}
private void ToIdleState(PlayerNetwork player)
{
if (player.animationFrames >= 100 && !player.comboLocked)
2023-01-02 19:59:46 +02:00
{
2023-01-28 03:45:14 +02:00
GameSimulation.Run = true;
2023-01-23 18:31:58 +02:00
EnterState(player, "Idle");
2023-01-02 19:59:46 +02:00
}
}
}