Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

EditorWindow.ShowPopup

マニュアルに切り替える
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(); } }