r2mods/ilspy_dump/ror2_csproj/RoR2/AncientWispFireController.cs

65 lines
1.1 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2;
[RequireComponent(typeof(CharacterModel))]
public class AncientWispFireController : MonoBehaviour
{
public ParticleSystem normalParticles;
public Light normalLight;
public ParticleSystem rageParticles;
public Light rageLight;
private CharacterModel characterModel;
private void Awake()
{
characterModel = GetComponent<CharacterModel>();
}
private void Update()
{
bool flag = false;
CharacterBody body = characterModel.body;
if ((bool)body)
{
flag = body.HasBuff(JunkContent.Buffs.EnrageAncientWisp);
}
if ((bool)normalParticles)
{
ParticleSystem.EmissionModule emission = normalParticles.emission;
if (emission.enabled == flag)
{
emission.enabled = !flag;
if (!flag)
{
normalParticles.Play();
}
}
}
if ((bool)rageParticles)
{
ParticleSystem.EmissionModule emission2 = rageParticles.emission;
if (emission2.enabled != flag)
{
emission2.enabled = flag;
if (flag)
{
rageParticles.Play();
}
}
}
if ((bool)normalLight)
{
normalLight.enabled = !flag;
}
if ((bool)rageLight)
{
rageLight.enabled = flag;
}
}
}