r2mods/ilspy_dump/ror2_csproj/EntityStates.VoidRaidCrab.J.../DeathState.cs

54 lines
1.2 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.VoidRaidCrab.Joint;
public class DeathState : GenericCharacterDeath
{
[SerializeField]
public string joint1Name;
[SerializeField]
public string joint2Name;
[SerializeField]
public string joint3Name;
[SerializeField]
public GameObject joint1EffectPrefab;
[SerializeField]
public GameObject joint2EffectPrefab;
[SerializeField]
public GameObject joint3EffectPrefab;
private CharacterModel characterModel;
public override void OnEnter()
{
base.OnEnter();
EffectManager.SimpleMuzzleFlash(joint1EffectPrefab, base.gameObject, joint1Name, transmit: false);
EffectManager.SimpleMuzzleFlash(joint2EffectPrefab, base.gameObject, joint2Name, transmit: false);
EffectManager.SimpleMuzzleFlash(joint3EffectPrefab, base.gameObject, joint3Name, transmit: false);
Transform modelTransform = GetModelTransform();
if ((bool)modelTransform)
{
characterModel = modelTransform.GetComponent<CharacterModel>();
}
if ((bool)characterModel)
{
characterModel.invisibilityCount++;
}
}
public override void OnExit()
{
if ((bool)characterModel)
{
characterModel.invisibilityCount--;
}
base.OnExit();
}
}