Version: 2019.2
public void ShowPopup ();

説明

ポップアップスタイルのフレーミングを使用するエディターウィンドウを表示します

これはウィンドウはフレームを持たず、ドラッグできないことを意味します。すでにあるウィンドウ内のポップアップメニューのようなものを表示するためのものです。



このメソッドを使用してウィンドウを開くことはポップアップウィンドウの機能を与えず、スタイリングのみです。完全なポップアップ機能のために (例えばウィンドウがフォーカスを失ったときに自動で閉じるなど)、PopupWindowを使用します。

using UnityEngine;
using UnityEditor;

public class ShowPopupExample : EditorWindow { [MenuItem("Example/ShowPopup Example")] static void Init() { ShowPopupExample window = ScriptableObject.CreateInstance<ShowPopupExample>(); window.position = new Rect(Screen.width / 2, Screen.height / 2, 250, 150); window.ShowPopup(); }

void OnGUI() { EditorGUILayout.LabelField("This is an example of EditorWindow.ShowPopup", EditorStyles.wordWrappedLabel); GUILayout.Space(70); if (GUILayout.Button("Agree!")) this.Close(); } }