[增加]1. 增加UI代码生成器的入口

This commit is contained in:
Blank 2024-08-30 12:01:47 +08:00
parent 13a6e245f8
commit a2732a550a
2 changed files with 38 additions and 0 deletions

27
Editor/UICodeGenerator.cs Normal file
View File

@ -0,0 +1,27 @@
using UnityEditor;
using UnityEngine;
namespace GameFrameX.UI.UGUI.Editor
{
[InitializeOnLoad]
internal static class UICodeGenerator
{
/// <summary>
/// 生成UI代码
/// </summary>
[MenuItem("GameObject/UGUI/Code", false, 1)]
static void Code()
{
// Debug.Log("Test");
if (Selection.activeObject)
{
var activeObject = (GameObject)Selection.activeObject;
if (activeObject)
{
var ugui = activeObject.GetComponent<GameFrameX.UI.UGUI.Runtime.UGUI>();
Debug.Log(ugui);
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1ea4334b0c0c8684f9f934d6719391a2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: