initial commit

This commit is contained in:
Jo 2025-01-07 02:06:59 +01:00
parent 6715289efe
commit 788c3389af
37645 changed files with 2526849 additions and 80 deletions

View file

@ -0,0 +1,80 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if ENABLE_VR || ENABLE_AR
using UnityEngine.XR.LegacyInputHelpers;
namespace UnityEditor.XR.LegacyInputHelpers
{
[CustomEditor(typeof(ArmModel))]
internal class ArmModelEditor : Editor
{
protected static class ArmModelStyles
{
public static GUIContent poseSourceLabel = EditorGUIUtility.TrTextContent("Input Pose Source", "The source of the 3dof controller data");
public static GUIContent headPositionSourceLabel = EditorGUIUtility.TrTextContent("Head Position Source", "The source of head position data used by the arm model");
public static GUIContent isLockedToNeckLabel = EditorGUIUtility.TrTextContent("Lock To Neck", "If true, the root of the pose is locked to the local position of the player's neck");
public static GUIContent armExtensionOffsetLabel = EditorGUIUtility.TrTextContent("Arm Extension Offset", "Offset applied to the elbow position as the controller is rotated upwards");
public static GUIContent elbowBendRatioLabel = EditorGUIUtility.TrTextContent("Elbow Bend Ratio", "Amount of the controller's rotation to apply to the elbow");
public static GUIContent elbowRestPositionLabel = EditorGUIUtility.TrTextContent("Elbow","The Elbow's Position relative to the users head");
public static GUIContent wristRestPositionLabel = EditorGUIUtility.TrTextContent("Wrist","The Wrist's Position relative to the users head");
public static GUIContent controllerRestPositionLabel = EditorGUIUtility.TrTextContent("Controller", "The Controller position relative to the users head");
public static GUIContent restPositionLabel = EditorGUIUtility.TrTextContent("Rest Position");
}
protected SerializedProperty m_PoseSourceProp = null;
protected SerializedProperty m_HeadGameObjectProp = null;
protected SerializedProperty m_IsLockedToNeckProp = null;
protected SerializedProperty m_ArmExtensionOffsetProp = null;
protected SerializedProperty m_EblowRestPositionProp = null;
protected SerializedProperty m_WristRestPositionProp = null;
protected SerializedProperty m_ControllerRestPositionProp = null;
protected SerializedProperty m_ElbowBendRatioProp = null;
protected bool m_ExpandRestPosition = false;
protected virtual void OnEnable()
{
m_PoseSourceProp = this.serializedObject.FindProperty("m_PoseSource");
m_HeadGameObjectProp = this.serializedObject.FindProperty("m_HeadPoseSource");
m_IsLockedToNeckProp = this.serializedObject.FindProperty("m_IsLockedToNeck");
m_ArmExtensionOffsetProp = this.serializedObject.FindProperty("m_ElbowRestPosition");
m_EblowRestPositionProp = this.serializedObject.FindProperty("m_ElbowRestPosition");
m_WristRestPositionProp = this.serializedObject.FindProperty("m_WristRestPosition");
m_ControllerRestPositionProp = this.serializedObject.FindProperty("m_ControllerRestPosition");
m_ElbowBendRatioProp = this.serializedObject.FindProperty("m_ElbowBendRatio");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_PoseSourceProp, ArmModelStyles.poseSourceLabel);
EditorGUILayout.PropertyField(m_HeadGameObjectProp, ArmModelStyles.headPositionSourceLabel);
EditorGUILayout.PropertyField(m_ArmExtensionOffsetProp, ArmModelStyles.armExtensionOffsetLabel);
EditorGUILayout.PropertyField(m_ElbowBendRatioProp, ArmModelStyles.elbowBendRatioLabel);
EditorGUILayout.PropertyField(m_IsLockedToNeckProp, ArmModelStyles.isLockedToNeckLabel);
m_ExpandRestPosition = EditorGUILayout.Foldout(m_ExpandRestPosition,ArmModelStyles.restPositionLabel);
if (m_ExpandRestPosition)
{
using (EditorGUI.IndentLevelScope indent = new EditorGUI.IndentLevelScope())
{
EditorGUILayout.PropertyField(m_EblowRestPositionProp, ArmModelStyles.elbowRestPositionLabel);
EditorGUILayout.PropertyField(m_WristRestPositionProp, ArmModelStyles.wristRestPositionLabel);
EditorGUILayout.PropertyField(m_ControllerRestPositionProp, ArmModelStyles.controllerRestPositionLabel);
}
}
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fd661411ada16794aa7015ddf3778407
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,106 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if ENABLE_VR || ENABLE_AR
using UnityEngine.XR.LegacyInputHelpers;
namespace UnityEditor.XR.LegacyInputHelpers
{
[CustomEditor(typeof(SwingArmModel))]
internal class SwingArmModelEditor : ArmModelEditor
{
protected static class SwingArmModelStyles
{
public static GUIContent rotationRatioLabel = EditorGUIUtility.TrTextContent("Rotation Ratio");
public static GUIContent shoulderRotationRatioLabel = EditorGUIUtility.TrTextContent("Shoulder", "Portion of controller rotation applied to the shoulder joint");
public static GUIContent elbowRotationRatioLabel = EditorGUIUtility.TrTextContent("Elbow", "Portion of controller rotation applied to the elbow joint");
public static GUIContent wristRotationRatioLabel = EditorGUIUtility.TrTextContent("Wrist", "Portion of controller rotation applied to the wrist joint");
public static GUIContent shiftedRotationRatioLabel = EditorGUIUtility.TrTextContent("Shifted Rotation Ratio");
public static GUIContent shiftedShoulderRotationRatioLabel = EditorGUIUtility.TrTextContent("Shifted Shoulder","Portion of controller rotation applied to the shoulder joint when the controller is backwards");
public static GUIContent shiftedElbowRotationRatioLabel = EditorGUIUtility.TrTextContent("Shifted Elbow", "Portion of controller rotation applied to the elbow joint when the controller is backwards");
public static GUIContent shiftedWristRotationRatioLabel = EditorGUIUtility.TrTextContent("Shifted Wrist", "Portion of controller rotation applied to the wrist joint when the controller is backwards");
public static GUIContent jointShiftAngleLabel = EditorGUIUtility.TrTextContent("Joint Shift Angle", "The min/max angle of the controller before starting to lerp towards the shifted joint ratios");
public static GUIContent jointShiftExponentLabel = EditorGUIUtility.TrTextContent("Joint Shift Exponent", "Exponent applied to the joint shift ratio to control the curve of the shift");
}
SerializedProperty m_ShoulderRotationRatioProp = null;
SerializedProperty m_EblowRotationRatioProp = null;
SerializedProperty m_WristRotationRatioProp = null;
SerializedProperty m_ShiftedShoulderRotationRatioProp = null;
SerializedProperty m_ShiftedEblowRotationRatioProp = null;
SerializedProperty m_ShiftedWristRotationRatioProp = null;
SerializedProperty m_JointShiftAngleProp = null;
SerializedProperty m_JointShiftExponentProp = null;
bool m_ExpandShoulder = false;
bool m_ExpandShiftedShoulder = false;
protected override void OnEnable()
{
base.OnEnable();
m_ShoulderRotationRatioProp = this.serializedObject.FindProperty("m_ShoulderRotationRatio");
m_EblowRotationRatioProp = this.serializedObject.FindProperty("m_ElbowRotationRatio");
m_WristRotationRatioProp = this.serializedObject.FindProperty("m_WristRotationRatio");
m_ShiftedShoulderRotationRatioProp = this.serializedObject.FindProperty("m_ShiftedShoulderRotationRatio");
m_ShiftedEblowRotationRatioProp = this.serializedObject.FindProperty("m_ShiftedElbowRotationRatio");
m_ShiftedWristRotationRatioProp = this.serializedObject.FindProperty("m_ShiftedWristRotationRatio");
m_JointShiftAngleProp = this.serializedObject.FindProperty("m_JointShiftAngle");
m_JointShiftExponentProp = this.serializedObject.FindProperty("m_JointShiftExponent");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_PoseSourceProp, ArmModelStyles.poseSourceLabel);
EditorGUILayout.PropertyField(m_HeadGameObjectProp, ArmModelStyles.headPositionSourceLabel);
EditorGUILayout.PropertyField(m_ArmExtensionOffsetProp, ArmModelStyles.armExtensionOffsetLabel);
EditorGUILayout.PropertyField(m_JointShiftAngleProp, SwingArmModelStyles.jointShiftAngleLabel);
EditorGUILayout.PropertyField(m_JointShiftExponentProp, SwingArmModelStyles.jointShiftExponentLabel);
EditorGUILayout.PropertyField(m_ElbowBendRatioProp, ArmModelStyles.elbowBendRatioLabel);
EditorGUILayout.PropertyField(m_IsLockedToNeckProp, ArmModelStyles.isLockedToNeckLabel);
m_ExpandRestPosition = EditorGUILayout.Foldout(m_ExpandRestPosition, ArmModelStyles.restPositionLabel);
if (m_ExpandRestPosition)
{
using (EditorGUI.IndentLevelScope indent = new EditorGUI.IndentLevelScope())
{
EditorGUILayout.PropertyField(m_EblowRestPositionProp, ArmModelStyles.elbowRestPositionLabel);
EditorGUILayout.PropertyField(m_WristRestPositionProp, ArmModelStyles.wristRestPositionLabel);
EditorGUILayout.PropertyField(m_ControllerRestPositionProp, ArmModelStyles.controllerRestPositionLabel);
}
}
m_ExpandShoulder = EditorGUILayout.Foldout(m_ExpandShoulder, SwingArmModelStyles.rotationRatioLabel);
if (m_ExpandShoulder)
{
using (EditorGUI.IndentLevelScope indent = new EditorGUI.IndentLevelScope())
{
EditorGUILayout.PropertyField(m_ShoulderRotationRatioProp, SwingArmModelStyles.shoulderRotationRatioLabel);
EditorGUILayout.PropertyField(m_EblowRotationRatioProp, SwingArmModelStyles.elbowRotationRatioLabel);
EditorGUILayout.PropertyField(m_WristRotationRatioProp, SwingArmModelStyles.wristRotationRatioLabel);
}
}
m_ExpandShiftedShoulder = EditorGUILayout.Foldout(m_ExpandShiftedShoulder, SwingArmModelStyles.shiftedRotationRatioLabel);
if (m_ExpandShiftedShoulder)
{
using (EditorGUI.IndentLevelScope indent = new EditorGUI.IndentLevelScope())
{
EditorGUILayout.PropertyField(m_ShiftedShoulderRotationRatioProp, SwingArmModelStyles.shiftedShoulderRotationRatioLabel);
EditorGUILayout.PropertyField(m_ShiftedEblowRotationRatioProp, SwingArmModelStyles.shiftedElbowRotationRatioLabel);
EditorGUILayout.PropertyField(m_ShiftedWristRotationRatioProp, SwingArmModelStyles.shiftedWristRotationRatioLabel);
}
}
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 759b8a665f0e4234db4a1b9a1514aa1d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,46 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if ENABLE_VR || ENABLE_AR
using UnityEngine.XR.LegacyInputHelpers;
namespace UnityEditor.XR.LegacyInputHelpers
{
[CustomEditor(typeof(TransitionArmModel))]
internal class TransitionArmModelEditor : Editor
{
static class Styles
{
public static GUIContent poseSourceLabel = EditorGUIUtility.TrTextContent("Angular Velocity Source", "The source of angular velocity which is used to transition to queued arm models");
public static GUIContent armModelSourceLabel = EditorGUIUtility.TrTextContent("Current Arm Model", "The current arm model ");
public static GUIContent armModelTransitions = EditorGUIUtility.TrTextContent("Configuration", "Arm models that the transition arm model can blend to when receiving the event corresponding to the transition");
}
SerializedProperty m_PoseSourceProp = null;
SerializedProperty m_ArmModelProp = null;
SerializedProperty m_ArmModelTransitions = null;
void OnEnable()
{
m_PoseSourceProp = this.serializedObject.FindProperty("m_PoseSource");
m_ArmModelProp = this.serializedObject.FindProperty("m_CurrentArmModelComponent");
m_ArmModelTransitions = this.serializedObject.FindProperty("m_ArmModelTransitions");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_PoseSourceProp, Styles.poseSourceLabel);
EditorGUILayout.PropertyField(m_ArmModelProp, Styles.armModelSourceLabel);
EditorGUILayout.PropertyField(m_ArmModelTransitions, Styles.armModelTransitions,true);
serializedObject.ApplyModifiedProperties();
}
}
}
#endif

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d0771c912c4d7c841b238a454ec571cb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: