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

スクリプト言語

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

EditorGUI.BoundsField

フィードバック

ありがとうございます

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

閉じる

送信に失敗しました

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

閉じる

キャンセル

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

パラメーター

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

戻り値

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

説明

Bounds を入力する Center と Extents フィールドを作成します。


" Editor Window の Bounds Field ”

	// Simple script that shows radius of bounds of selected MeshFilter

class EditorGUILayoutBoundsField extends EditorWindow {

var radius : float = 0; var bounds : Bounds;

@MenuItem("Examples/Show Radius of mesh bounds") static function Init() { var window = GetWindow(EditorGUILayoutBoundsField); window.Show(); } function OnGUI() { GUILayout.Label("Select a mesh in the Hierarchy view and click 'Capture Bounds'"); EditorGUILayout.BeginHorizontal(); bounds = EditorGUILayout.BoundsField("Mesh bounds:", bounds); if(GUILayout.Button("Capture Bounds") && Selection.activeTransform) { var meshFilter : MeshFilter = Selection.activeTransform.GetComponentInChildren(MeshFilter); if (meshFilter) bounds = meshFilter.sharedMesh.bounds; } EditorGUILayout.EndHorizontal(); EditorGUILayout.LabelField("Radius:", bounds.size.magnitude.ToString()); if(GUILayout.Button("Close")) this.Close(); } }