36 lines
706 B
C#
36 lines
706 B
C#
|
using UnityEngine;
|
||
|
|
||
|
namespace EntityStates.Turret1;
|
||
|
|
||
|
public class SpawnState : BaseState
|
||
|
{
|
||
|
public static float duration = 4f;
|
||
|
|
||
|
private static int SpawnStateHash = Animator.StringToHash("Spawn");
|
||
|
|
||
|
private static int SpawnParamHash = Animator.StringToHash("Spawn.playbackRate");
|
||
|
|
||
|
public override void OnEnter()
|
||
|
{
|
||
|
base.OnEnter();
|
||
|
if ((bool)GetModelAnimator())
|
||
|
{
|
||
|
PlayAnimation("Body", SpawnStateHash, SpawnParamHash, 1.5f);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public override void FixedUpdate()
|
||
|
{
|
||
|
base.FixedUpdate();
|
||
|
if (base.fixedAge >= duration && base.isAuthority)
|
||
|
{
|
||
|
outer.SetNextStateToMain();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public override InterruptPriority GetMinimumInterruptPriority()
|
||
|
{
|
||
|
return InterruptPriority.Death;
|
||
|
}
|
||
|
}
|