37 lines
784 B
C#
37 lines
784 B
C#
|
using RoR2;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace EntityStates.JellyfishMonster;
|
||
|
|
||
|
public class SpawnState : BaseState
|
||
|
{
|
||
|
public static float duration = 4f;
|
||
|
|
||
|
public static string spawnSoundString;
|
||
|
|
||
|
private static int SpawnStateHash = Animator.StringToHash("Spawn");
|
||
|
|
||
|
private static int SpawnParamHash = Animator.StringToHash("Spawn.playbackRate");
|
||
|
|
||
|
public override void OnEnter()
|
||
|
{
|
||
|
base.OnEnter();
|
||
|
PlayAnimation("Body", SpawnStateHash, SpawnParamHash, duration);
|
||
|
Util.PlaySound(spawnSoundString, base.gameObject);
|
||
|
}
|
||
|
|
||
|
public override void FixedUpdate()
|
||
|
{
|
||
|
base.FixedUpdate();
|
||
|
if (base.fixedAge >= duration && base.isAuthority)
|
||
|
{
|
||
|
outer.SetNextStateToMain();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public override InterruptPriority GetMinimumInterruptPriority()
|
||
|
{
|
||
|
return InterruptPriority.Death;
|
||
|
}
|
||
|
}
|