- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
- 纳金币
- 38268
- 精华
- 111
|
- using UnityEngine;
- using UnityEditor;
- public class MyWindow : EditorWindow
- {
- // Add menu named "My Window" to the Window menu
- [MenuItem ("Window/My Window")]
- static void Init () {
- // Get existing open window or if none, make a new one:
- MyWindow window = (MyWindow)EditorWindow.GetWindow (typeof (MyWindow));
- void OnGUI ()
- {//unity3d:www.unitymanual.com
- GUILayout.Label ("Base Settings", EditorStyles.boldLabel);myString
- EditorGUILayout.TextField ("Text Field", myString);groupEnabled
- EditorGUILayout.BeginToggleGroup ("Optional Settings", groupEnabled);
- myBool = EditorGUILayout.Toggle ("Toggle", myBool);
- myFloat = EditorGUILayout.Slider ("Slider", myFloat, -3, 3);
- EditorGUILayout.EndToggleGroup ();
- EditorGUIUtility.LookLikeInspector ();
- EditorGUILayout.TextField ("Text Field:", "Hello There");
- EditorGUILayout.IntField("Int Field:", integer1);
- EditorGUILayout.FloatField("Float Field:", float1);
- EditorGUILayout.Space();
- EditorGUIUtility.LookLikeControls();
- EditorGUILayout.TextField ("Text Field", "Hello There");
- EditorGUILayout.IntField("Int Field:", integer1);
- EditorGUILayout.FloatField("Float Field:", float1);
- }
- }
复制代码 * 版权声明:转载时请以超链接形式标明文章原始出处和作者信息
* 本文来自:Unity3D教程手册
* 本文链接:http://www.unitymanual.com/7092.html
|
|