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

48 lines
1.1 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.NullifierMonster;
public class SpawnState : BaseState
{
public static float duration = 4f;
public static string spawnSoundString;
public static GameObject spawnEffectPrefab;
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);
if ((bool)spawnEffectPrefab)
{
EffectManager.SimpleMuzzleFlash(spawnEffectPrefab, base.gameObject, "PortalEffect", transmit: false);
}
Transform modelTransform = GetModelTransform();
if ((bool)modelTransform)
{
modelTransform.GetComponent<PrintController>().enabled = true;
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (base.fixedAge >= duration && base.isAuthority)
{
outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return InterruptPriority.Death;
}
}