SphericalBillboardDemo.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using UnityEngine;
  3. using Xft;
  4. public class SphericalBillboardDemo : MonoBehaviour
  5. {
  6. private void Start()
  7. {
  8. this.QuadExplode.Initialize();
  9. this.SphericalExplode.Initialize();
  10. this.QuadFogs.Initialize();
  11. this.SphericalFogs.Initialize();
  12. }
  13. private void ActiveEffect(XffectComponent xft)
  14. {
  15. this.QuadExplode.DeActive();
  16. this.SphericalExplode.DeActive();
  17. this.QuadFogs.DeActive();
  18. this.SphericalFogs.DeActive();
  19. xft.Active();
  20. }
  21. private void OnGUI()
  22. {
  23. if (GUI.Button(new Rect(0f, 0f, 200f, 30f), "Spherical Explode"))
  24. {
  25. this.ActiveEffect(this.SphericalExplode);
  26. }
  27. if (GUI.Button(new Rect(0f, 30f, 200f, 30f), "QuadExplode"))
  28. {
  29. this.ActiveEffect(this.QuadExplode);
  30. }
  31. if (GUI.Button(new Rect(0f, 60f, 200f, 30f), "Spherical Fogs"))
  32. {
  33. this.ActiveEffect(this.SphericalFogs);
  34. }
  35. if (GUI.Button(new Rect(0f, 90f, 200f, 30f), "Quad Fogs"))
  36. {
  37. this.ActiveEffect(this.QuadFogs);
  38. }
  39. }
  40. public XffectComponent QuadExplode;
  41. public XffectComponent SphericalExplode;
  42. public XffectComponent QuadFogs;
  43. public XffectComponent SphericalFogs;
  44. }