Files
2026-02-21 16:45:37 +08:00

24 lines
599 B
C#

using UnityEngine;
namespace UnityStandardAssets.Effects
{
public class ParticleSystemMultiplier : MonoBehaviour
{
public float multiplier = 1f;
private void Start()
{
ParticleSystem[] componentsInChildren = GetComponentsInChildren<ParticleSystem>();
ParticleSystem[] array = componentsInChildren;
foreach (ParticleSystem particleSystem in array)
{
particleSystem.startSize *= multiplier;
particleSystem.startSpeed *= multiplier;
particleSystem.startLifetime *= Mathf.Lerp(multiplier, 1f, 0.5f);
particleSystem.Clear();
particleSystem.Play();
}
}
}
}