| 12345678910111213141516171819202122232425 |
- #if UNITY_EDITOR
- using UnityEditor;
- using UnityEngine;
- namespace YIUIFramework.Editor
- {
- internal static class YIUI3DDisplayMenuItem
- {
- [MenuItem("GameObject/YIUI/3DDisplay", false, 20001)]
- private static void Create3DDisplay()
- {
- var activeObject = Selection.activeObject as GameObject;
- if (activeObject == null)
- {
- UnityTipsHelper.ShowError($"请选择一个对象 右键创建");
- return;
- }
- var path = $"Packages/cn.etetet.yiui3ddisplay/Editor/TemplatePrefabs/YIUI3DDisplay.prefab";
- Selection.activeObject = UIMenuItemHelper.CloneGameObjectByPath(path, activeObject.transform);
- }
- }
- }
- #endif
|