r2mods/ilspy_dump/ror2_csproj/EntityStates.HermitCrab/SpawnState.cs

43 lines
972 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.HermitCrab;
public class SpawnState : BaseState
{
private float stopwatch;
public static GameObject burrowPrefab;
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();
Util.PlaySound(spawnSoundString, base.gameObject);
PlayAnimation("Body", SpawnStateHash, SpawnParamHash, duration);
EffectManager.SimpleMuzzleFlash(burrowPrefab, base.gameObject, "BurrowCenter", transmit: false);
}
public override void FixedUpdate()
{
base.FixedUpdate();
stopwatch += GetDeltaTime();
if (stopwatch >= duration && base.isAuthority)
{
outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return InterruptPriority.Death;
}
}