FTME01_ScaleManipulatorSize.cs 1002 B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using System.Collections;
  3. using ParticlePlayground;
  4. public class FTME01_ScaleManipulatorSize : MonoBehaviour {
  5. float origManiScale;
  6. float origManiStrength;
  7. public float scaleManipulatorSize = 1f;
  8. PlaygroundParticlesC particles;
  9. public void ScaleManipulatorSizeOnEnable () {
  10. if (particles==null)
  11. particles = GetComponent<PlaygroundParticlesC>();
  12. foreach (ManipulatorObjectC manipulator in particles.manipulators) {
  13. origManiScale = manipulator.size;
  14. origManiStrength = manipulator.strength;
  15. }
  16. }
  17. public void ScaleManipulatorSizeOnDisable () {
  18. foreach (ManipulatorObjectC manipulator in particles.manipulators) {
  19. manipulator.size = origManiScale;
  20. manipulator.strength = origManiStrength;
  21. }
  22. }
  23. public void ScaleManipulatorSize () {
  24. foreach (ManipulatorObjectC manipulator in particles.manipulators) {
  25. manipulator.size = origManiScale * scaleManipulatorSize;
  26. manipulator.strength = origManiStrength * scaleManipulatorSize;
  27. }
  28. }
  29. }