MegaShapeWizard.cs 953 B

1234567891011121314151617181920212223242526272829303132
  1. 
  2. using UnityEngine;
  3. using UnityEditor;
  4. #if false
  5. public class MegaShapeWizard : ScriptableWizard
  6. {
  7. public float range = 500;
  8. public Color color = Color.red;
  9. [MenuItem ("GameObject/Create Light Wizard")]
  10. static void CreateWizard () {
  11. ScriptableWizard.DisplayWizard<WizardCreateLight>("Create Light", "Create", "Apply");
  12. //If you don't want to use the secondary button simply leave it out:
  13. //ScriptableWizard.DisplayWizard<WizardCreateLight>("Create Light", "Create");
  14. }
  15. void OnWizardCreate () {
  16. GameObject go = new GameObject ("New Light");
  17. go.AddComponent("Light");
  18. go.light.range = range;
  19. go.light.color = color;
  20. }
  21. void OnWizardUpdate () {
  22. helpString = "Please set the color of the light!";
  23. }
  24. // When the user pressed the "Apply" button OnWizardOtherButton is called.
  25. void OnWizardOtherButton () {
  26. if (Selection.activeTransform == null ||
  27. Selection.activeTransform.light == null) return;
  28. Selection.activeTransform.light.color = Color.red;
  29. }
  30. #endif