FTME01_ScaleStateSize.cs 772 B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine;
  2. using System.Collections;
  3. using ParticlePlayground;
  4. public class FTME01_ScaleStateSize : MonoBehaviour {
  5. float origStateScale;
  6. public float scaleState = 1f;
  7. PlaygroundParticlesC particles;
  8. public void ScaleStateSizeOnEnable () {
  9. if (particles==null)
  10. particles = GetComponent<PlaygroundParticlesC>();
  11. foreach (ParticleStateC activeState in particles.states) {
  12. origStateScale = activeState.stateScale;
  13. }
  14. }
  15. public void ScaleStateSizeOnDisable () {
  16. foreach (ParticleStateC activeState in particles.states) {
  17. activeState.stateScale = origStateScale;
  18. }
  19. }
  20. public void ScaleStateSize () {
  21. foreach (ParticleStateC activeState in particles.states) {
  22. activeState.stateScale = origStateScale * scaleState;
  23. }
  24. }
  25. }