SCInputFieldTool.cs 971 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEditor;
  5. using UnityEditor.SceneManagement;
  6. using UnityEngine;
  7. using UnityEngine.Events;
  8. using UnityEngine.UI;
  9. using SC.XR.Unity;
  10. public class SCInputFieldTool : Editor
  11. {
  12. [MenuItem("Tools/SCInputField => SCInputField")]
  13. private static void ChangeSCInputFieldColor()
  14. {
  15. if (Selection.objects.Length > 0)
  16. {
  17. for (int i = 0; i < Selection.objects.Length; i++)
  18. {
  19. if ((Selection.objects[i] as GameObject).GetComponent<SC.XR.Unity.SCInputField>())
  20. {
  21. GameObject obj = Selection.objects[i] as GameObject;
  22. SC.XR.Unity.SCInputField o_SCInputField = obj.GetComponent<SC.XR.Unity.SCInputField>();
  23. GameObject o = new GameObject();
  24. DestroyImmediate(o);
  25. }
  26. }
  27. }
  28. }
  29. }