Add ultimate xr
This commit is contained in:
56
Assets/UltimateXR/Editor/UI/UxrCameraPointerEditor.cs
Normal file
56
Assets/UltimateXR/Editor/UI/UxrCameraPointerEditor.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="UxrCameraPointerEditor.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using UltimateXR.UI;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UltimateXR.Editor.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Serialized property for <see cref="UxrCameraPointer" />.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(UxrCameraPointer))]
|
||||
public class UxrCameraPointerEditor : UnityEditor.Editor
|
||||
{
|
||||
#region Unity
|
||||
|
||||
/// <summary>
|
||||
/// Caches the serialized properties.
|
||||
/// </summary>
|
||||
private void OnEnable()
|
||||
{
|
||||
_propertyRayLength = serializedObject.FindProperty("_rayLength");
|
||||
_propertyCrosshair = serializedObject.FindProperty("_crosshair");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the custom inspector and handles user input.
|
||||
/// </summary>
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(_propertyRayLength, ContentRayLength);
|
||||
EditorGUILayout.PropertyField(_propertyCrosshair, ContentCrosshair);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Types & Data
|
||||
|
||||
private GUIContent ContentRayLength { get; } = new GUIContent("Ray Length", "Length of the raycast in units");
|
||||
private GUIContent ContentCrosshair { get; } = new GUIContent("Crosshair", "Optional crosshair object. This will allow the component to disable its colliders if there are any.");
|
||||
|
||||
private SerializedProperty _propertyRayLength;
|
||||
private SerializedProperty _propertyCrosshair;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user