Add ultimate xr

This commit is contained in:
2024-08-06 21:58:35 +02:00
parent 864033bf10
commit 7165bacd9d
3952 changed files with 2162037 additions and 35 deletions

View File

@@ -0,0 +1,73 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UxrControlInputEditor.cs" company="VRMADA">
// Copyright (c) VRMADA, All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
using UltimateXR.UI.UnityInputModule.Controls;
using UnityEditor;
using UnityEditor.EventSystems;
namespace UltimateXR.Editor.UI.UnityInputModule.Controls
{
/// <summary>
/// Custom inspector for <see cref="UxrControlInput" />. Needs to inherit from <see cref="EventTriggerEditor" />
/// because <see cref="UxrControlInput" /> is an EventTrigger-derived component.
/// </summary>
[CustomEditor(typeof(UxrControlInput))]
[CanEditMultipleObjects]
public class UxrControlInputEditor : EventTriggerEditor
{
#region Unity
/// <summary>
/// Caches the serialized properties.
/// </summary>
protected override void OnEnable()
{
_propertyPressAndHoldDuration = serializedObject.FindProperty("_pressAndHoldDuration");
_propertyFeedbackOnDown = serializedObject.FindProperty("_feedbackOnPress");
_propertyFeedbackOnUp = serializedObject.FindProperty("_feedbackOnRelease");
_propertyFeedbackOnClick = serializedObject.FindProperty("_feedbackOnClick");
}
/// <summary>
/// Draws the custom inspector, including the one implemented in child classes.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(_propertyPressAndHoldDuration);
EditorGUILayout.PropertyField(_propertyFeedbackOnDown, true);
EditorGUILayout.PropertyField(_propertyFeedbackOnUp, true);
EditorGUILayout.PropertyField(_propertyFeedbackOnClick, true);
// Child properties
OnControlInputInspectorGUI();
serializedObject.ApplyModifiedProperties();
}
#endregion
#region Event Trigger Methods
/// <summary>
/// Overridable method to draw child properties.
/// </summary>
protected virtual void OnControlInputInspectorGUI()
{
}
#endregion
#region Private Types & Data
private SerializedProperty _propertyPressAndHoldDuration;
private SerializedProperty _propertyFeedbackOnDown;
private SerializedProperty _propertyFeedbackOnUp;
private SerializedProperty _propertyFeedbackOnClick;
#endregion
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 0a21a128a44df5346945162cd1609436
timeCreated: 1471503516
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,78 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UxrToggleControlInputEditor.cs" company="VRMADA">
// Copyright (c) VRMADA, All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
using UltimateXR.UI.UnityInputModule.Controls;
using UnityEditor;
namespace UltimateXR.Editor.UI.UnityInputModule.Controls
{
/// <summary>
/// Custom inspector for <see cref="UxrToggleControlInput" />. Needs to inherit from
/// <see cref="UxrControlInputEditor" />.
/// </summary>
[CustomEditor(typeof(UxrToggleControlInput))]
[CanEditMultipleObjects]
public class UxrToggleControlInputEditor : UxrControlInputEditor
{
#region Unity
/// <summary>
/// Caches serialized properties.
/// </summary>
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
/// <summary>
/// Draws the inspector for the child properties.
/// </summary>
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
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 80b9dd85d5e8ab9458846b02721a9c86
timeCreated: 1471503516
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: