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,8 @@
fileFormatVersion: 2
guid: f7f094b068f7f7f458fdc6709ef403cd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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:

View File

@@ -0,0 +1,71 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UxrCanvasEditor.cs" company="VRMADA">
// Copyright (c) VRMADA, All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
using UltimateXR.UI.UnityInputModule;
using UnityEditor;
namespace UltimateXR.Editor.UI.UnityInputModule
{
/// <summary>
/// Custom inspector for <see cref="UxrCanvas" />.
/// </summary>
[CustomEditor(typeof(UxrCanvas))]
public class UxrCanvasEditor : UnityEditor.Editor
{
#region Unity
/// <summary>
/// Caches the serialized properties.
/// </summary>
private void OnEnable()
{
_propertyInteractionType = serializedObject.FindProperty("_interactionType");
_propertyFingerTipMinHoverDistance = serializedObject.FindProperty("_fingerTipMinHoverDistance");
_propertyAutoEnableLaserPointer = serializedObject.FindProperty("_autoEnableLaserPointer");
_propertyAutoEnableDistance = serializedObject.FindProperty("_autoEnableDistance");
_propertyAllowLeftHand = serializedObject.FindProperty("_allowLeftHand");
_propertyAllowRightHand = serializedObject.FindProperty("_allowRightHand");
}
/// <summary>
/// Draws the custom inspector and handles input.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(_propertyInteractionType);
if (_propertyInteractionType.enumNames[_propertyInteractionType.enumValueIndex] == UxrInteractionType.FingerTips.ToString())
{
EditorGUILayout.PropertyField(_propertyFingerTipMinHoverDistance);
}
if (_propertyInteractionType.enumNames[_propertyInteractionType.enumValueIndex] == UxrInteractionType.LaserPointers.ToString())
{
EditorGUILayout.PropertyField(_propertyAutoEnableLaserPointer);
EditorGUILayout.PropertyField(_propertyAutoEnableDistance);
}
EditorGUILayout.PropertyField(_propertyAllowLeftHand);
EditorGUILayout.PropertyField(_propertyAllowRightHand);
serializedObject.ApplyModifiedProperties();
}
#endregion
#region Private Types & Data
private SerializedProperty _propertyInteractionType;
private SerializedProperty _propertyFingerTipMinHoverDistance;
private SerializedProperty _propertyAutoEnableLaserPointer;
private SerializedProperty _propertyAutoEnableDistance;
private SerializedProperty _propertyAllowLeftHand;
private SerializedProperty _propertyAllowRightHand;
#endregion
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 6c8ae3ce172e6cc4abf198111709d0ef
timeCreated: 1512388722
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: