欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Unity 注释小技巧

程序员文章站 2022-06-17 09:44:59
...

你只需要在字段上添加特效即可 [Header( " 注释 " )][Space( 20 )] public Vector3 test1; ===================================================================================== 自己抽时间写了一个中文显示小脚本.下次问问老大能不能加到项目中去 usin

Unity 注释小技巧

你只需要在字段上添加特效即可


[Header("注释")]
[Space(20)]
public Vector3 test1;

=====================================================================================

Unity 注释小技巧自己抽时间写了一个中文显示小脚本.下次问问老大能不能加到项目中去

Unity 注释小技巧

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