Editor GUI Layout

ドキュメント:

UnityEditor.EditorGUILayout | Unity スクリプトリファレンス [公式]

使い方

参考:

int 型の入力フィールドを表示する | コガネブログ

いろいろな GUI ~ Editor GUI Layout 編 | ケットシーウェア

Begin / End 系メソッド

Scope 系メソッド

参考:

Editor 拡張で等間隔に並べたい時は Begin / End より Scope を使おう – Qiita

Editor Window で使える Scope 一覧 | うにてぃブログ

Field 系メソッド

  • BoundsField
  • BoundsIntField
  • ColorField
  • CurveField
  • DelayedDoubleField
  • DelayedFloatField
  • DelayedIntField
  • DelayedTextField
  • DoubleField
  • EnumFlagsField
  • FloatField float 値を入力するテキストフィールドを作成する
  • GradientField
  • IntField 整数を入力するテキストフィールドを作成する
  • LabelField ラベルを表示する
  • LayerField レイヤー選択フィールドを作成する
  • LongField
  • MaskField マスク選択フィールドを作成する/返り値は int 型のマスク値となる
  • ObjectField 任意の型のオブジェクトを表示するフィールド/オブジェクトをドロップまたはピッカーで割り当てることができる
  • PasswordField
  • PropertyField SerializedProperty のフィールドを作成する/実際のフィールドは SerializedProperty に含まれている型によって決まる
  • RectField 矩形の X / Y / W / H を入力するフィールドを作成する
  • RectIntField
  • TagField タグ選択フィールドを作成する
  • TextField テキスト入力フィールドを作成する
  • Vector2Field
  • Vector2IntField
  • Vector3Field
  • Vector3IntField
  • Vector4Field

参考:

Unity Editor で利用できる Field 一覧 | うにてぃブログ

Make an non editable Field in editor – Unity Discussions

その他のメソッド

  • DropdownButton
  • EditorToolbar
  • EditorToolbarForTarget
  • EnumPopup
  • Foldout
  • GetControlRect
  • HelpBox
  • InspectorTitlebar
  • IntPopup
  • IntSlider
  • LinkButton
  • MinMaxSlider指定された範囲で最小値と最大値を設定する「最小最大スライダー」を作成する
  • Popupポップアップ選択フィールド/ドロップダウンリストを作成する
  • PrefixLabel
  • SelectableLabel
  • Sliderスライダーを作成する/最小値と最大値の間で設定された float 値を返す
  • Space
  • TextArea
  • Toggle
  • ToggleLeft
  • ToolContextToolbar
  • ToolContextToolbarForTarget

Slider

ドキュメント:

EditorGUILayout.Slider | Unity スクリプトリファレンス [公式]

参考:

float 型のスライダーを表示する | コガネブログ

slider bar in inspector – Unity Discussions

MinMaxSlider

ドキュメント:

EditorGUILayout.MinMaxSlider | Unity スクリプトリファレンス [公式]

参考:

最小値と最大値を設定するスライダーを表示する | コガネブログ

EnumPopup

ドキュメント:

EditorGUILayout.EnumPopup | Unity スクリプトリファレンス [公式]

参考:

列挙型のポップアップメニューを表示する | コガネブログ

ObjectField

public ExampleClass test;

void OnInspectorGUI() {
    test = (ExampleClass)EditorGUILayout.ObjectField(
        "Test", test, typeof(ExampleClass));
}Code language: C# (cs)

ドキュメント:

EditorGUILayout.ObjectField | Unity スクリプトリファレンス [公式]

参考:

EditorGUILayout.ObjectField does not recieve reference – Stack Overflow

PropertyField

ドキュメント:

EditorGUILayout.PropertyField | Unity スクリプトリファレンス [公式]

参考:

Draw default property types in Custom Property Drawer – Unity Answers

TextArea

参考:

テキストの入力エリアを表示する | コガネブログ

Foldout

ドキュメント:

EditorGUILayout.BeginFoldoutHeaderGroup | Unity スクリプトリファレンス [公式]

EditorGUILayout.EndFoldoutHeaderGroup | Unity スクリプトリファレンス [公式]

まとめ

エディタ拡張チートシート | LIGHT11

見た目を整える | Unity でコードから GUI を作る (kumaS)

Editor 拡張で使える UI 機能の概要 | yotiky Tech Blog

記事をシェアする:
タグ:

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Protected by reCAPTCHA