public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var attr = (ClassDropdown)attribute; var wasEnabled = GUI.enabled; if (attr.Readonly) { GUI.enabled = false; property.stringValue = attr.types[0].AssemblyQualifiedName; } ClassDropDownHelper.ShowClassDropDown(position, attr.types, property.displayName, property); GUI.enabled = wasEnabled; }
public static void DrawSpawnTagInspectorGUI(ActorSpawnTag tag) { GUI.enabled = false; EditorGUILayout.IntField("SpawnId", tag.spawnID); var changed = false; GUI.enabled = !tag.typeIsReadOnly; var typeName = ClassDropDownHelper <T> .ShowClassDropDown("Actor Class", tag.typeName); if (tag.typeName != typeName) { tag.typeName = typeName; changed = true; } GUI.enabled = !tag.replicatesIsReadOnly; var replicates = EditorGUILayout.Toggle("Replicates", tag.replicates); if (tag.replicates != replicates) { tag.replicates = replicates; changed = true; } GUI.enabled = !tag.staticSpawnIsReadOnly; var staticSpawn = EditorGUILayout.Toggle("Static", tag.staticSpawn); if (tag.staticSpawn != staticSpawn) { tag.staticSpawn = staticSpawn; changed = true; } GUI.enabled = true; if (changed) { EditorUtility.SetDirty(tag); } }
public static void ShowClassDropDown(string label, SerializedProperty property) { ClassDropDownHelper.ShowClassDropDown(_types.types, label, property); }
public static string ShowClassDropDown(string label, string current) { return(ClassDropDownHelper.ShowClassDropDown(_types.types, label, current)); }