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

スクリプト言語

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

EditorGUI.RectField

フィードバック

ありがとうございます

この度はドキュメントの品質向上のためにご意見・ご要望をお寄せいただき、誠にありがとうございます。頂いた内容をドキュメントチームで確認し、必要に応じて修正を致します。

閉じる

送信に失敗しました

なんらかのエラーが発生したため送信が出来ませんでした。しばらく経ってから<a>もう一度送信</a>してください。ドキュメントの品質向上のために時間を割いて頂き誠にありがとうございます。

閉じる

キャンセル

マニュアルに切り替える
public static function RectField(position: Rect, value: Rect): Rect;
public static Rect RectField(Rect position, Rect value);
public static function RectField(position: Rect, label: string, value: Rect): Rect;
public static Rect RectField(Rect position, string label, Rect value);
public static function RectField(position: Rect, label: GUIContent, value: Rect): Rect;
public static Rect RectField(Rect position, GUIContent label, Rect value);

パラメーター

position 表示位置
label フィールドのラベル
value 編集する値

戻り値

Rect ユーザーによって設定された値

説明

Rect を入力する X 、 Y 、 W と H のフィールドを作成します。


" Editor Window の Rect field "

	// Find all the cameras in the scene and shows all their viewports togheter
	
	class EditorGUIRectField extends EditorWindow {
		
		var cameras : Camera[];
		
		@MenuItem("Examples/Editor GUI RectField usage")
		static function Init() {
			var window = GetWindow(EditorGUIRectField);
			window.position = Rect(0,0,150,120);
			window.Show();
		}
		
		function OnGUI() {
			if(GUI.Button(Rect(3,3,position.width-6,20),"Update list"))	
				cameras = FindObjectsOfType(Camera);
			
			if(cameras)
			for(var i = 0; i < cameras.Length; i++) {
				cameras[i].rect = EditorGUI.RectField(
						Rect(3,25+45*i,position.width - 6, 25),
						cameras[i].name,
						cameras[i].rect);
			}
		}
	}

説明

SerializedProperty を使用して Rect の X 、 Y 、 W と H のフィールドを作成します(一般的ではありません) 。