unity3d ~黑科技~ 打开一个无边框窗体

直接上图
unity3d ~黑科技~ 打开一个无边框窗体_第1张图片

using UnityEngine;
using UnityEditor;
using System.Collections;

public class L004Window : EditorWindow
{
    static L004Window instance = null;

    public static void OpenWindow()
    {
        if (instance == null)
        {
            instance = (L004Window)ScriptableObject.CreateInstance();
            instance.position = new Rect(500, 300, 600, 400);
        }
        instance.ShowPopup();
        instance.Focus();
    }

    void Update()
    {
        if (EditorWindow.focusedWindow != this) this.Close();
    }
}

你可能感兴趣的:(迷途吧的编辑器魔法)