Version: 2022.1
言語: 日本語
public static void PrefixLabel (string label, GUIStyle followingStyle= "Button");
public static void PrefixLabel (string label, GUIStyle followingStyle, GUIStyle labelStyle);
public static void PrefixLabel (GUIContent label, GUIStyle followingStyle= "Button");
public static void PrefixLabel (GUIContent label, GUIStyle followingStyle, GUIStyle labelStyle);

パラメーター

label コントロールの左に表示するラベル

説明

いくつかのコントロールの前にラベルを作成します。


Simple window that shows the prefix label.

Note that most editor controls already have built-in optional labels that can be specified as one of the parameters. PrefixLabel can be used when there is no such built-in label available, or when you're creating your own editor control from scratch.

PrefixLabel もラベルをクリックしたとき、リンクされたコントロールがキーボードフォーカスを取得するのを(コントロールがキーボードフォーカスをサポートする場合) 確実にします。ラベルはその後に来る次のコントロールに自動的にリンクされます。

using UnityEditor;
using UnityEngine;

public class ExampleClass : EditorWindow { static int ammo = 0;

[MenuItem("Examples/Prefix Label Usage")] static void Init() { ExampleClass window = (ExampleClass)GetWindow(typeof(ExampleClass)); window.Show(); }

public void OnGUI() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Ammo"); ammo = EditorGUILayout.IntField(ammo); EditorGUILayout.EndHorizontal(); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961