Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
[ExecuteAlways]
/// <summary>
/// MM delay particles.
/// </summary>
[AddComponentMenu("More Mountains/Tools/Particles/MMDelayParticles")]
public class MMDelayParticles : MonoBehaviour
{
[Header("Delay")]
/// the duration of the delay, in seconds
public float Delay;
/// if this is true, this will delay by the same amount all children particle systems of this object
public bool DelayChildren = true;
/// if this is true, the delay will be applied on Start
public bool ApplyDelayOnStart = false;
[MMInspectorButtonAttribute("ApplyDelay")]
public bool ApplyDelayButton;
protected Component[] particleSystems;
protected virtual void Start()
{
if (ApplyDelayOnStart)
{
ApplyDelay();
}
}
protected virtual void ApplyDelay()
{
if (this.gameObject.GetComponent<ParticleSystem>() != null)
{
ParticleSystem.MainModule main = this.gameObject.GetComponent<ParticleSystem>().main;
main.startDelay = main.startDelay.constant + Delay;
}
particleSystems = GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem system in particleSystems)
{
ParticleSystem.MainModule main = system.main;
main.startDelay = main.startDelay.constant + Delay;
}
}
}
}