Unity 注释小技巧
程序员文章站
2024-04-05 09:08:42
...
你只需要在字段上添加特效即可 [Header( " 注释 " )][Space( 20 )] public Vector3 test1; ===================================================================================== 自己抽时间写了一个中文显示小脚本.下次问问老大能不能加到项目中去 usin
你只需要在字段上添加特效即可
[Header("注释")] [Space(20)] public Vector3 test1;
=====================================================================================
自己抽时间写了一个中文显示小脚本.下次问问老大能不能加到项目中去
using UnityEngine; using System.Collections; using UnityEditor; using System; using System.Reflection; using System.Collections.Generic; [CustomEditor(typeof(MyCompoment))] public class MyCompomentEditor : Editor{ public MyCompomentEditor():base() { //Debug.Log("我初始化了"); } private static bool isDevelop = true; public override void OnInspectorGUI() { if (isDevelop) { MyCompoment edit = (MyCompoment)target; Type t = edit.GetType(); string label = string.Empty; FieldInfo[] fieldInfs = t.GetFields(); System.Object[] atrrs = null; for (int i = 0; i ) { atrrs