EditorInit.cs 851 B

123456789101112131415161718192021222324
  1. using UnityEditor;
  2. using UnityEngine;
  3. public static class EditorInit
  4. {
  5. /*
  6. [MenuItem("EditorExtensions/ProjectInit")]
  7. static void Init()
  8. {
  9. // SetBtn 设置父子关系
  10. Transform CenterCamera = GameObject.Find("SDKSystem/NRCameraRig/CenterCamera").gameObject.transform;
  11. Transform SetBtn = GameObject.Find("SetBtn").gameObject.transform;
  12. SetBtn.SetParent(CenterCamera);
  13. Debug.LogError("SetBtn 设置父子关系");
  14. // MoveScenePanel 设置父子关系
  15. GameObject MoveScenePanel = GameObject.Find("EditorCanvas/MoveScenePanel");
  16. MoveScenePanel.SetActive(false);
  17. Transform AnchorBtn = SetBtn.Find("AnchorBtn");
  18. MoveScenePanel.transform.SetParent(AnchorBtn);
  19. Debug.LogError("MoveScenePanel 设置父子关系");
  20. }
  21. */
  22. }