纳金网
标题:
Unity3d添加编辑器窗口
[打印本页]
作者:
狂风大尉
时间:
2014-6-25 01:18
标题:
Unity3d添加编辑器窗口
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
作者:
hyui
时间:
2014-6-25 02:24
Thanks for sharing this!
作者:
wucnj
时间:
2014-6-25 09:03
感谢分享!!!
作者:
hariboot
时间:
2014-6-25 09:05
Thanks for sharing this!
作者:
HIDEOKOJIMA
时间:
2014-6-25 16:51
感谢分享!
欢迎光临 纳金网 (http://rs.narkii.com/club/)
Powered by Discuz! X2.5