Seven is the number.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
792 B

  1. using System;
  2. using UnityEngine;
  3. namespace UnityStandardAssets.Effects
  4. {
  5. public class ParticleSystemMultiplier : MonoBehaviour
  6. {
  7. // a simple script to scale the size, speed and lifetime of a particle system
  8. public float multiplier = 1;
  9. private void Start()
  10. {
  11. var systems = GetComponentsInChildren<ParticleSystem>();
  12. foreach (ParticleSystem system in systems)
  13. {
  14. ParticleSystem.MainModule mainModule = system.main;
  15. mainModule.startSizeMultiplier *= multiplier;
  16. mainModule.startSpeedMultiplier *= multiplier;
  17. mainModule.startLifetimeMultiplier *= Mathf.Lerp(multiplier, 1, 0.5f);
  18. system.Clear();
  19. system.Play();
  20. }
  21. }
  22. }
  23. }