Pulver trash maze sequence
This commit is contained in:
@@ -7,33 +7,39 @@ namespace Editor
|
||||
/// <summary>
|
||||
/// Custom editor for ControllerSwitchItem that shows only relevant fields based on camera switch mode.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(ControllerSwitchItem))]
|
||||
[CustomEditor(typeof(ControllerSwitchItem), true)]
|
||||
public class ControllerSwitchItemEditor : UnityEditor.Editor
|
||||
{
|
||||
private SerializedProperty _targetControllerName;
|
||||
private SerializedProperty _cameraSwitchMode;
|
||||
private SerializedProperty _targetVirtualCamera;
|
||||
private SerializedProperty _targetCameraState;
|
||||
private SerializedProperty _visualRepresentation;
|
||||
protected SerializedProperty _targetControllerName;
|
||||
protected SerializedProperty _visualRepresentation;
|
||||
|
||||
// Base class properties
|
||||
private SerializedProperty _isOneTime;
|
||||
private SerializedProperty _cooldown;
|
||||
private SerializedProperty _characterToInteract;
|
||||
protected SerializedProperty _isOneTime;
|
||||
protected SerializedProperty _cooldown;
|
||||
protected SerializedProperty _characterToInteract;
|
||||
|
||||
// Base interactable events
|
||||
protected SerializedProperty _interactionStarted;
|
||||
protected SerializedProperty _interactionInterrupted;
|
||||
protected SerializedProperty _characterArrived;
|
||||
protected SerializedProperty _interactionComplete;
|
||||
|
||||
private void OnEnable()
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
// Controller Switch Settings
|
||||
_targetControllerName = serializedObject.FindProperty("targetControllerName");
|
||||
_cameraSwitchMode = serializedObject.FindProperty("cameraSwitchMode");
|
||||
_targetVirtualCamera = serializedObject.FindProperty("targetVirtualCamera");
|
||||
_targetCameraState = serializedObject.FindProperty("targetCameraState");
|
||||
_visualRepresentation = serializedObject.FindProperty("visualRepresentation");
|
||||
|
||||
// Base class properties
|
||||
_isOneTime = serializedObject.FindProperty("isOneTime");
|
||||
_cooldown = serializedObject.FindProperty("cooldown");
|
||||
_characterToInteract = serializedObject.FindProperty("characterToInteract");
|
||||
|
||||
// Base interactable events
|
||||
_interactionStarted = serializedObject.FindProperty("interactionStarted");
|
||||
_interactionInterrupted = serializedObject.FindProperty("interactionInterrupted");
|
||||
_characterArrived = serializedObject.FindProperty("characterArrived");
|
||||
_interactionComplete = serializedObject.FindProperty("interactionComplete");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
@@ -58,34 +64,10 @@ namespace Editor
|
||||
// Controller Switch Settings
|
||||
EditorGUILayout.LabelField("Controller Switch Settings", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(_targetControllerName);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Camera Settings
|
||||
EditorGUILayout.LabelField("Camera Settings", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(_cameraSwitchMode);
|
||||
|
||||
// Show relevant camera fields based on mode
|
||||
CameraSwitchMode mode = (CameraSwitchMode)_cameraSwitchMode.enumValueIndex;
|
||||
|
||||
switch (mode)
|
||||
if (string.IsNullOrEmpty(_targetControllerName.stringValue))
|
||||
{
|
||||
case CameraSwitchMode.None:
|
||||
EditorGUILayout.HelpBox("No camera switching will occur. Only the controller will be switched.", MessageType.Info);
|
||||
break;
|
||||
|
||||
case CameraSwitchMode.DirectReference:
|
||||
EditorGUILayout.PropertyField(_targetVirtualCamera);
|
||||
if (_targetVirtualCamera.objectReferenceValue == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Assign a Cinemachine camera to blend to when switching controllers.", MessageType.Warning);
|
||||
}
|
||||
break;
|
||||
|
||||
case CameraSwitchMode.TrashMazeCameraState:
|
||||
EditorGUILayout.PropertyField(_targetCameraState);
|
||||
EditorGUILayout.HelpBox("Uses TrashMazeCameraController to switch camera state. Make sure TrashMazeCameraController is present in the scene.", MessageType.Info);
|
||||
break;
|
||||
EditorGUILayout.HelpBox("Assign a target controller name (must match registration name in InputManager).", MessageType.Warning);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
@@ -93,9 +75,28 @@ namespace Editor
|
||||
// Visual Feedback
|
||||
EditorGUILayout.LabelField("Visual Feedback", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(_visualRepresentation);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Base Interactable Events
|
||||
EditorGUILayout.LabelField("Interaction Events", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(_interactionStarted);
|
||||
EditorGUILayout.PropertyField(_interactionInterrupted);
|
||||
EditorGUILayout.PropertyField(_characterArrived);
|
||||
EditorGUILayout.PropertyField(_interactionComplete);
|
||||
|
||||
DrawCustomFields();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override this in derived editors to add custom fields specific to derived classes
|
||||
/// </summary>
|
||||
protected virtual void DrawCustomFields()
|
||||
{
|
||||
// Base class has no additional custom fields
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user