ChangeParticle.cs 718 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using UnityEngine;
  3. public class ChangeParticle : BaseBehaviour
  4. {
  5. private void OnEnable()
  6. {
  7. this.ChangeParticles();
  8. }
  9. private void Start()
  10. {
  11. this.ChangeParticles();
  12. }
  13. private void Update()
  14. {
  15. }
  16. public void ChangeParticles()
  17. {
  18. if (base.GetComponent<FBParticleType>() != null && !this.useAverageSpeed)
  19. {
  20. base.GetComponent<FBParticleType>().speed1.x = UnityEngine.Random.Range(this.minSpeed, this.maxSpeed);
  21. }
  22. }
  23. [SerializeField]
  24. public float minSpeed;
  25. [SerializeField]
  26. public float maxSpeed;
  27. [SerializeField]
  28. public bool usePosition;
  29. [SerializeField]
  30. public bool useAverageSpeed;
  31. [SerializeField]
  32. public float positionY;
  33. }