// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) VRMADA, All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------
using UltimateXR.UI.UnityInputModule.Controls;
using UnityEditor;
namespace UltimateXR.Editor.UI.UnityInputModule.Controls
{
///
/// Custom inspector for . Needs to inherit from
/// .
///
[CustomEditor(typeof(UxrToggleControlInput))]
[CanEditMultipleObjects]
public class UxrToggleControlInputEditor : UxrControlInputEditor
{
#region Unity
///
/// Caches serialized properties.
///
protected override void OnEnable()
{
base.OnEnable();
_propertyInitialState = serializedObject.FindProperty("_initialState");
_propertyCanToggleOnlyOnce = serializedObject.FindProperty("_canToggleOnlyOnce");
_propertyText = serializedObject.FindProperty("_text");
_propertyEnableWhenSelected = serializedObject.FindProperty("_enableWhenSelected");
_propertyEnableWhenNotSelected = serializedObject.FindProperty("_enableWhenNotSelected");
_propertyTextColorChanges = serializedObject.FindProperty("_textColorChanges");
_propertyAudioToggleOn = serializedObject.FindProperty("_audioToggleOn");
_propertyAudioToggleOff = serializedObject.FindProperty("_audioToggleOff");
_propertyAudioToggleOnVolume = serializedObject.FindProperty("_audioToggleOnVolume");
_propertyAudioToggleOffVolume = serializedObject.FindProperty("_audioToggleOffVolume");
}
#endregion
#region Event Trigger Methods
///
/// Draws the inspector for the child properties.
///
protected override void OnControlInputInspectorGUI()
{
EditorGUILayout.PropertyField(_propertyInitialState);
EditorGUILayout.PropertyField(_propertyCanToggleOnlyOnce);
EditorGUILayout.PropertyField(_propertyText);
EditorGUILayout.PropertyField(_propertyEnableWhenSelected);
EditorGUILayout.PropertyField(_propertyEnableWhenNotSelected);
EditorGUILayout.PropertyField(_propertyTextColorChanges);
EditorGUILayout.PropertyField(_propertyAudioToggleOn);
EditorGUILayout.PropertyField(_propertyAudioToggleOff);
EditorGUILayout.PropertyField(_propertyAudioToggleOnVolume);
EditorGUILayout.PropertyField(_propertyAudioToggleOffVolume);
}
#endregion
#region Private Types & Data
private SerializedProperty _propertyInitialState;
private SerializedProperty _propertyCanToggleOnlyOnce;
private SerializedProperty _propertyText;
private SerializedProperty _propertyEnableWhenSelected;
private SerializedProperty _propertyEnableWhenNotSelected;
private SerializedProperty _propertyTextColorChanges;
private SerializedProperty _propertyAudioToggleOn;
private SerializedProperty _propertyAudioToggleOff;
private SerializedProperty _propertyAudioToggleOnVolume;
private SerializedProperty _propertyAudioToggleOffVolume;
#endregion
}
}