Version: 2020.3
言語: 日本語
public static EditorWindow GetWindowWithRect (Type t, Rect rect, bool utility= false, string title= null);

パラメーター

t ウィンドウのタイプ。EditorWindow から派生したタイプでなくてはいけません
rect 新しく作成されたウィンドウが表示されるスクリーン上の位置
utility フローティングのユーティリティウィンドウを作成するには、これを True に設定し、通常のウィンドウを作成する場合は False を設定します。
title GetWindow が新しいウィンドウを作成する場合、このタイトルを取得します。この値が null の場合、クラス名をタイトルとして使用します。

説明

現在画面上にある t タイプの最初に見つけた EditorWindow を返します

存在しない場合、 Rect の位置に新しいウィンドウを作成して表示し、そのインスタンスを返します。


Create an empty 100x150px window at the upper left corner of the screen.

using UnityEngine;
using UnityEditor;

// Create a dockable empty window at the top left corner of the screen // with 100px width and 150px height

public class EditorWindowTest : EditorWindow { [MenuItem("Example/Display simple sized Window")] static void Initialize() { EditorWindowTest window = (EditorWindowTest)EditorWindow.GetWindowWithRect(typeof(EditorWindowTest), new Rect(0, 0, 100, 150)); } }

public static T GetWindowWithRect (Rect rect);
public static T GetWindowWithRect (Rect rect, bool utility);
public static T GetWindowWithRect (Rect rect, bool utility, string title);
public static T GetWindowWithRect (Rect rect, bool utility, string title, bool focus);

パラメーター

t ウィンドウのタイプ。EditorWindow から派生したタイプでなくてはいけません
rect 新しく作成されたウィンドウが表示されるスクリーン上の位置
utility フローティングのユーティリティウィンドウを作成するには、これを True に設定し、通常のウィンドウを作成する場合は False を設定します。
title GetWindow が新しいウィンドウを作成する場合、このタイトルを取得します。この値が null の場合、クラス名をタイトルとして使用します。
focus それがすでに存在する場合、ウィンドウフォーカスを与えるかどうか ( GetWindow が新しいウィンドウを作成する場合、それは常にフォーカスを取得します)。

説明

現在画面上にある t タイプの最初に見つけた EditorWindow を返します

存在しない場合、 Rect の位置に新しいウィンドウを作成して表示し、そのインスタンスを返します。