r2mods/ilspy_dump/ror2_csproj/EntityStates.MajorConstruct.../RaisedToLowered.cs

49 lines
1011 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.MajorConstruct.Stance;
public class RaisedToLowered : BaseState
{
[SerializeField]
public float duration;
[SerializeField]
public string muzzleName;
[SerializeField]
public GameObject muzzleEffectPrefab;
[SerializeField]
public string animationLayerName;
[SerializeField]
public string animationStateName;
[SerializeField]
public string animationPlaybackRateParameter;
[SerializeField]
public string enterSoundString;
public override void OnEnter()
{
base.OnEnter();
PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParameter, duration);
if ((bool)muzzleEffectPrefab)
{
EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, base.gameObject, muzzleName, transmit: false);
}
Util.PlaySound(enterSoundString, base.gameObject);
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (base.fixedAge >= duration && base.isAuthority)
{
outer.SetNextState(new Lowered());
}
}
}