ButtonMenu.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. namespace SC.Common
  6. {
  7. public class ButtonMenu : Editor {
  8. [MenuItem("GameObject/ShadowSystem/SCButton")]
  9. public static void CreateSCButton()
  10. {
  11. GameObject added = GameObject.Find ("SCButton");
  12. GameObject obj;
  13. GameObject sel;
  14. if (added != null) {
  15. DestroyImmediate (added);
  16. }
  17. obj = (GameObject)Resources.Load ("Prefabs/SCButton");
  18. sel = (GameObject)Instantiate (obj);
  19. sel.name = "SCButton";
  20. }
  21. [MenuItem("GameObject/ShadowSystem/UIButton")]
  22. public static void CreateUIButton() {
  23. GameObject added = GameObject.Find("UIButton");
  24. GameObject obj;
  25. GameObject sel;
  26. if(added != null) {
  27. DestroyImmediate(added);
  28. }
  29. obj = (GameObject)Resources.Load("Prefabs/UIButton");
  30. sel = (GameObject)Instantiate(obj);
  31. sel.name = "UIButton";
  32. }
  33. }
  34. }