Entwicklung - Unity3D - Web

Online-Gedächtnis - Stichpunkte zur Erinnerungshilfe

NAVIGATION - SEARCH

Inspector- / Editorverschönerung

Code-Tags welche Auswirkungen auf die Darstellung im Inspector haben.

[Range(0, 100)]
public float MyValue;

[Header("Hi there!")]
public string TheHeader = "Header!";
[Tooltip("This is THE VALUE!")]
[ContextMenuItem("Reset", "resetTheValue")]
public float TheValue = 42.0f;
[Space(50)]
public string TheString = "THE STRING";

private void resetTheValue()
{
    TheValue = 42;
}

Listen:


private ReorderableList list;

list = new ReorderableList(property.serializedObject, property.FindPropertyRelative("tagList"), true, true, true, true);
list.drawHeaderCallback += rect => GUI.Label(rect, label);
list.drawElementCallback += (rect, index, active, focused) =>
{
    rect.height = 16;
    rect.y += 2;
    EditorGUI.PropertyField(rect, 
        list.serializedProperty.GetArrayElementAtIndex(index), 
        GUIContent.none);
};
list.DoList(position);

Quelle: Gamasutra
Kommentare sind geschlossen