r2mods/ilspy_dump/ror2_csproj/RoR2/CloverEffect.cs

33 lines
722 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2;
public class CloverEffect : MonoBehaviour
{
public GameObject triggerEffect;
private CharacterBody characterBody;
private GameObject triggerEffectInstance;
private bool trigger;
private void Start()
{
CharacterBody body = GetComponentInParent<CharacterModel>().body;
characterBody = body.GetComponent<CharacterBody>();
}
private void FixedUpdate()
{
if ((bool)characterBody && characterBody.wasLucky)
{
characterBody.wasLucky = false;
EffectData effectData = new EffectData();
effectData.origin = base.transform.position;
effectData.rotation = base.transform.rotation;
EffectManager.SpawnEffect(triggerEffect, effectData, transmit: true);
}
}
}