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

54 lines
1.1 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.MajorConstruct.Weapon;
public class ChargeLaser : BaseState
{
[SerializeField]
public float duration;
[SerializeField]
public string animationLayerName;
[SerializeField]
public string animationStateName;
[SerializeField]
public string animationPlaybackParameterName;
[SerializeField]
public string muzzleName;
[SerializeField]
public GameObject muzzleEffectPrefab;
[SerializeField]
public string enterSoundString;
public override void OnEnter()
{
base.OnEnter();
PlayAnimation(animationLayerName, animationStateName, animationPlaybackParameterName, 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 FireLaser());
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return InterruptPriority.Pain;
}
}