UI_ParticleSize.cs 684 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using UnityEngine;
  3. public class UI_ParticleSize : UI_ScreenFitBase
  4. {
  5. protected override void Start()
  6. {
  7. this.m_MyParticle = base.GetComponent<ParticleSystem>();
  8. this.m_FirstSize = this.m_MyParticle.main.startSizeMultiplier;
  9. if (this.m_FirstSize < this.m_MinSize)
  10. {
  11. this.m_MinSize = this.m_FirstSize;
  12. }
  13. base.Start();
  14. }
  15. protected override void Update()
  16. {
  17. base.Update();
  18. }
  19. protected override void FitAction()
  20. {
  21. this.m_MyParticle.main.startSize = base.ScreenRate(this.m_MinSize, this.m_FirstSize, this.m_FirstSize);
  22. }
  23. [SerializeField]
  24. private float m_MinSize = 0.15f;
  25. private ParticleSystem m_MyParticle;
  26. private float m_FirstSize;
  27. }