DevicesTargetCreat.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using UnityEngine;
  7. using UnityEditor;
  8. using Object = UnityEngine.Object;
  9. public class DevicesTargetCreat : EditorWindow
  10. {
  11. public Transform creatContent;
  12. public Object jsonFile;
  13. public Vector3 creatPos;
  14. [MenuItem("Plugins/DevicesTargetCreat")]
  15. static void Init()
  16. {
  17. DevicesTargetCreat DevicesTargetCreatTool = EditorWindow.CreateWindow<DevicesTargetCreat>();
  18. DevicesTargetCreatTool.Show();
  19. }
  20. public void OnGUI()
  21. {
  22. creatPos=EditorGUILayout.Vector3Field("生成坐标", creatPos);
  23. jsonFile = Selection.activeObject;
  24. if (GUILayout.Button("生成参照物"))
  25. {
  26. if (jsonFile == null)
  27. {
  28. Debug.LogError("没选择Json!");
  29. return;
  30. }
  31. int tempCount = 0;
  32. int abIndex = 0;
  33. string path = AssetDatabase.GetAssetPath(jsonFile);
  34. }
  35. }
  36. }