unity 编辑器工具扩展

来源:互联网 发布:淘宝如何完成开店认证 编辑:程序博客网 时间:2024/04/30 07:31

画属性按钮

using UnityEngine;using System.Collections;public enum h{mon=0,tus,wen,}public class DataInEditer : MonoBehaviour {public int int_Editer=1;public h today=h.wen;public AnimationCurve curve;}

using UnityEngine;using System.Collections;using UnityEditor;[CustomEditor(typeof(DataInEditer))]public class EditorData : Editor {public override void OnInspectorGUI (){NGUIEditorTools.SetLabelWidth(100f);NGUIEditorTools.DrawProperty("Scaling Style", serializedObject, "int_Editer");NGUIEditorTools.DrawProperty("Scaling Style", serializedObject, "int_Editer");NGUIEditorTools.SetLabelWidth(80f);NGUIEditorTools.DrawProperty("today", serializedObject, "today");NGUIEditorTools.DrawProperty("curve", serializedObject, "curve");}}

效果图


0 0