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

スクリプト言語

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

EditorWindow.GetWindowWithRect

マニュアルに切り替える
public static EditorWindow GetWindowWithRect(Type t, Rect rect, bool utility = false, string title = null);
public static EditorWindow GetWindowWithRect(Type t, Rect rect, bool utility = false, string title = null);
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 の位置に新しいウィンドウを作成して表示し、そのインスタンスを返します。


"スクリーンの左上隅に空の 100x150 px ウィンドウを作成します。"

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 の位置に新しいウィンドウを作成して表示し、そのインスタンスを返します。