r2mods/ilspy_dump/ror2_csproj/BeginRapidlyActivatingAndDe...

29 lines
585 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
public class BeginRapidlyActivatingAndDeactivating : MonoBehaviour
{
public float blinkFrequency = 10f;
public float delayBeforeBeginningBlinking = 30f;
public GameObject blinkingRootObject;
private float fixedAge;
private float blinkAge;
private void FixedUpdate()
{
fixedAge += Time.fixedDeltaTime;
if (fixedAge >= delayBeforeBeginningBlinking)
{
blinkAge += Time.fixedDeltaTime;
if (blinkAge >= 1f / blinkFrequency)
{
blinkAge -= 1f / blinkFrequency;
blinkingRootObject.SetActive(!blinkingRootObject.activeSelf);
}
}
}
}