public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); SerializedProperty valueProperty = property.FindPropertyRelative("_value"); SerializedProperty tagLibraryProperty = property.FindPropertyRelative("_tagLibrary"); position.height = 16; tagLibraryProperty.objectReferenceValue = EditorGUI.ObjectField(position, tagLibraryProperty.objectReferenceValue, typeof(ImpactTagLibraryBase), false); position.y += 18; position.height = 16; ImpactTagLibraryBase tagLibrary = tagLibraryProperty.objectReferenceValue as ImpactTagLibraryBase; if (tagLibrary != null) { ImpactTagNameList tagNames = new ImpactTagNameList(ImpactTagLibraryConstants.TagCount); ImpactEditorUtilities.GetTagNames(tagLibrary, ref tagNames); ImpactEditorUtilities.TagDropdown(property, valueProperty, tagNames, position); } else { valueProperty.intValue = EditorGUI.IntField(position, valueProperty.intValue); } EditorGUI.EndProperty(); }
private void updateTagNames() { ImpactEditorUtilities.GetTagNames(material.TagLibrary, ref tagNames); }