Update inspector to be less annoying
This commit is contained in:
@@ -14,6 +14,9 @@ namespace Interactions
|
||||
SerializedProperty characterArrivedProp;
|
||||
SerializedProperty interactionCompleteProp;
|
||||
|
||||
private bool showBaseSettings = true;
|
||||
private bool showEvents = false;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
isOneTimeProp = serializedObject.FindProperty("isOneTime");
|
||||
@@ -29,13 +32,29 @@ namespace Interactions
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.LabelField("Interaction Settings", EditorStyles.boldLabel);
|
||||
// Draw child-specific properties first (anything not part of base class)
|
||||
DrawPropertiesExcluding(serializedObject,
|
||||
"m_Script",
|
||||
"isOneTime",
|
||||
"cooldown",
|
||||
"characterToInteract",
|
||||
"interactionStarted",
|
||||
"interactionInterrupted",
|
||||
"characterArrived",
|
||||
"interactionComplete");
|
||||
|
||||
// Base Interaction Settings (Collapsible)
|
||||
EditorGUILayout.Space(10);
|
||||
showBaseSettings = EditorGUILayout.Foldout(showBaseSettings, "Base Interaction Settings", true, EditorStyles.foldoutHeader);
|
||||
if (showBaseSettings)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(isOneTimeProp);
|
||||
EditorGUILayout.PropertyField(cooldownProp);
|
||||
EditorGUILayout.PropertyField(characterToInteractProp);
|
||||
|
||||
// Add the buttons for creating move targets
|
||||
EditorGUILayout.Space(10);
|
||||
// Character Move Targets (sub-section)
|
||||
EditorGUILayout.Space(5);
|
||||
EditorGUILayout.LabelField("Character Move Targets", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
@@ -80,12 +99,22 @@ namespace Interactions
|
||||
EditorGUILayout.HelpBox("Warning: Multiple move targets found that may conflict. Priority order: Both > Character-specific targets.", MessageType.Warning);
|
||||
}
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
// Interaction Events (Collapsible)
|
||||
EditorGUILayout.Space(10);
|
||||
EditorGUILayout.LabelField("Interaction Events", EditorStyles.boldLabel);
|
||||
showEvents = EditorGUILayout.Foldout(showEvents, "Interaction Events", true, EditorStyles.foldoutHeader);
|
||||
if (showEvents)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(interactionStartedProp);
|
||||
EditorGUILayout.PropertyField(interactionInterruptedProp);
|
||||
EditorGUILayout.PropertyField(characterArrivedProp);
|
||||
EditorGUILayout.PropertyField(interactionCompleteProp);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user