private void drawTagMaskFilter(SerializedProperty filterProperty, GUIContent label) { EditorGUILayout.BeginHorizontal(); SerializedProperty tagMaskProperty = filterProperty.FindPropertyRelative("TagMask"); SerializedProperty exactProperty = filterProperty.FindPropertyRelative("ExactMatch"); ImpactEditorUtilities.TagMaskPropertyEditor(tagMaskProperty, label, tagNames); exactProperty.boolValue = EditorGUILayout.ToggleLeft(new GUIContent("Exact", "Should the tags exactly match the specified tags?"), exactProperty.boolValue, GUILayout.Width(60)); EditorGUILayout.EndHorizontal(); }
private void drawInteractionsList() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Interaction Sets", EditorStyles.boldLabel); GUILayout.FlexibleSpace(); if (GUILayout.Button("New")) { ImpactMaterialInteractionSet newInteractionSet = new ImpactMaterialInteractionSet(); newInteractionSet.Name = "New Interaction Set"; material.AddInteractionSet(newInteractionSet); interactionFoldouts.Add(true); EditorUtility.SetDirty(target); } if (GUILayout.Button("Clear")) { if (EditorUtility.DisplayDialog("Clear All Interaction Sets", "Are you sure you want to remove all Interaction Sets? This cannot be undone.", "Yes", "No")) { material.ClearInteractionSets(); EditorUtility.SetDirty(target); } } EditorGUILayout.EndHorizontal(); if (material.InteractionSetCount == 0) { EditorGUILayout.HelpBox("No Interaction Sets have been added.", MessageType.Info); } else { EditorGUILayout.Separator(); for (int i = 0; i < Mathf.Min(interactionSetsProperty.arraySize, material.InteractionSetCount); i++) { drawInteractionSet(interactionSetsProperty.GetArrayElementAtIndex(i), material[i], i); } EditorGUILayout.Separator(); ImpactEditorUtilities.TagMaskPropertyEditor(fallbackTagsMaskProperty, new GUIContent("Fallback Tags", "Tags that will be used if the input tags are unknown."), tagNames); } }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(tagLibraryProperty, new GUIContent("Tag Library", "The Tag Library to use for displaying tag names.")); updateTagNames(); if (material.TagLibrary == null) { EditorGUILayout.HelpBox(ImpactTagLibraryConstants.TagLibraryNotFoundErrorMessage, MessageType.Info); } ImpactEditorUtilities.TagMaskPropertyEditor(materialTagsMaskProperty, new GUIContent("Material Tags", "The tags that apply to this material."), tagNames); ImpactEditorUtilities.Separator(); drawInteractionsList(); serializedObject.ApplyModifiedProperties(); }