鸟语天空
EditorWindow
post by:追风剑情 2014-7-30 21:00

using UnityEngine;
using UnityEditor;
using System.Collections;

static public class CustomMenu {

    [MenuItem("Custom/Create Window", false, 9)]
	static public void CreateWindow(){
        UICustomWindow window = EditorWindow.GetWindow<UICustomWindow>(false, "operate", true);
        window.maximized = false;
        window.maxSize = new Vector2(200, 100);
        window.Show();
    }
}

public class UICustomWindow : EditorWindow
{
    void OnGUI()
    {
        GUILayout.BeginVertical();
        GUILayout.Space(4f);
        GUILayout.Label("文件已存在");
        GUILayout.Space(6f);
        if (GUILayout.Button("override"))
        {
            this.Close();
        }
        GUILayout.Space(10f);
        if (GUILayout.Button("append (only new key)"))
        {
            this.Close();
        }
        GUILayout.EndVertical();
    }
}

运行效果

CreateWindow.png

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容