r2mods/ilspy_dump/ror2_csproj/EntityStates.InfiniteTowerS.../SelfDestruct.cs

37 lines
699 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
using UnityEngine.Networking;
namespace EntityStates.InfiniteTowerSafeWard;
public class SelfDestruct : BaseSafeWardState
{
[SerializeField]
public float duration;
[SerializeField]
public string animationLayerName;
[SerializeField]
public string animationStateName;
[SerializeField]
public string enterSoundString;
public override void OnEnter()
{
base.OnEnter();
PlayAnimation(animationLayerName, animationStateName);
Util.PlaySound(enterSoundString, base.gameObject);
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (NetworkServer.active && base.fixedAge >= duration)
{
EntityState.Destroy(base.gameObject);
}
}
}