private static void PreInitActions()
 {
     SteamVR_Actions.p_default_InteractUI        = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/InteractUI")));
     SteamVR_Actions.p_default_Teleport          = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/Teleport")));
     SteamVR_Actions.p_default_GrabPinch         = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/GrabPinch")));
     SteamVR_Actions.p_default_GrabGrip          = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/GrabGrip")));
     SteamVR_Actions.p_default_Pose              = ((SteamVR_Action_Pose)(SteamVR_Action.Create <SteamVR_Action_Pose>("/actions/default/in/Pose")));
     SteamVR_Actions.p_default_SkeletonLeftHand  = ((SteamVR_Action_Skeleton)(SteamVR_Action.Create <SteamVR_Action_Skeleton>("/actions/default/in/SkeletonLeftHand")));
     SteamVR_Actions.p_default_SkeletonRightHand = ((SteamVR_Action_Skeleton)(SteamVR_Action.Create <SteamVR_Action_Skeleton>("/actions/default/in/SkeletonRightHand")));
     SteamVR_Actions.p_default_Squeeze           = ((SteamVR_Action_Single)(SteamVR_Action.Create <SteamVR_Action_Single>("/actions/default/in/Squeeze")));
     SteamVR_Actions.p_default_HeadsetOnHead     = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/HeadsetOnHead")));
     SteamVR_Actions.p_default_SnapTurnLeft      = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/SnapTurnLeft")));
     SteamVR_Actions.p_default_SnapTurnRight     = ((SteamVR_Action_Vector2)(SteamVR_Action.Create <SteamVR_Action_Vector2>("/actions/default/in/SnapTurnRight")));
     SteamVR_Actions.p_default_Swipe             = ((SteamVR_Action_Vector2)(SteamVR_Action.Create <SteamVR_Action_Vector2>("/actions/default/in/Swipe")));
     SteamVR_Actions.p_default_SwipeLeft         = ((SteamVR_Action_Vector3)(SteamVR_Action.Create <SteamVR_Action_Vector3>("/actions/default/in/SwipeLeft")));
     SteamVR_Actions.p_default_Touch             = ((SteamVR_Action_Vector2)(SteamVR_Action.Create <SteamVR_Action_Vector2>("/actions/default/in/Touch")));
     SteamVR_Actions.p_default_Menu              = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/default/in/Menu")));
     SteamVR_Actions.p_default_Haptic            = ((SteamVR_Action_Vibration)(SteamVR_Action.Create <SteamVR_Action_Vibration>("/actions/default/out/Haptic")));
     SteamVR_Actions.p_platformer_Move           = ((SteamVR_Action_Vector2)(SteamVR_Action.Create <SteamVR_Action_Vector2>("/actions/platformer/in/Move")));
     SteamVR_Actions.p_platformer_Jump           = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/platformer/in/Jump")));
     SteamVR_Actions.p_buggy_Steering            = ((SteamVR_Action_Vector2)(SteamVR_Action.Create <SteamVR_Action_Vector2>("/actions/buggy/in/Steering")));
     SteamVR_Actions.p_buggy_Throttle            = ((SteamVR_Action_Single)(SteamVR_Action.Create <SteamVR_Action_Single>("/actions/buggy/in/Throttle")));
     SteamVR_Actions.p_buggy_Brake = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/buggy/in/Brake")));
     SteamVR_Actions.p_buggy_Reset = ((SteamVR_Action_Boolean)(SteamVR_Action.Create <SteamVR_Action_Boolean>("/actions/buggy/in/Reset")));
     SteamVR_Actions.p_mixedreality_ExternalCamera = ((SteamVR_Action_Pose)(SteamVR_Action.Create <SteamVR_Action_Pose>("/actions/mixedreality/in/ExternalCamera")));
 }
示例#2
0
 private void SteamVR_Behaviour_Vector3_OnAxis(SteamVR_Action_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta)
 {
     if (onAxis != null)
     {
         onAxis.Invoke(fromAction, fromSource, newAxis, newDelta);
     }
 }
 private void SteamVR_Behaviour_Vector3_OnChange(SteamVR_Action_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta)
 {
     if (onChange != null)
     {
         onChange.Invoke(this, fromSource, newAxis, newDelta);
     }
     if (onChangeEvent != null)
     {
         onChangeEvent.Invoke(this, fromSource, newAxis, newDelta);
     }
 }
        private void OnGUI()
        {
            if (labelStyle == null)
            {
                labelStyle = new GUIStyle(EditorStyles.textField);
                labelStyle.normal.background = Texture2D.whiteTexture;
            }

            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);

            Color defaultColor = GUI.backgroundColor;

            SteamVR_ActionSet[] actionSets = SteamVR_Input.actionSets;
            if (actionSets == null)
            {
                actionSets = SteamVR_Input_References.instance.actionSetObjects;
            }

            SteamVR_Input_Sources[] sources = SteamVR_Input_Source.GetUpdateSources();
            for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++)
            {
                SteamVR_Input_Sources source = sources[sourceIndex];
                EditorGUILayout.LabelField(source.ToString());

                for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++)
                {
                    SteamVR_ActionSet set            = actionSets[actionSetIndex];
                    string            activeText     = set.IsActive() ? "Active" : "Inactive";
                    float             setLastChanged = set.GetTimeLastChanged();

                    if (setLastChanged != -1)
                    {
                        float timeSinceLastChanged = Time.time - setLastChanged;
                        if (timeSinceLastChanged < 1)
                        {
                            Color setColor = Color.Lerp(Color.green, defaultColor, timeSinceLastChanged);
                            GUI.backgroundColor = setColor;
                        }
                    }

                    EditorGUILayout.LabelField(set.GetShortName(), activeText, labelStyle);
                    GUI.backgroundColor = defaultColor;

                    EditorGUI.indentLevel++;

                    for (int actionIndex = 0; actionIndex < set.allActions.Length; actionIndex++)
                    {
                        SteamVR_Action action = set.allActions[actionIndex];

                        if (action.actionSet == null || action.actionSet.IsActive() == false)
                        {
                            EditorGUILayout.LabelField(action.GetShortName(), "-", labelStyle);
                            continue;
                        }

                        float actionLastChanged = action.GetTimeLastChanged(source);

                        string actionText = "";

                        float timeSinceLastChanged = -1;

                        if (actionLastChanged != -1)
                        {
                            timeSinceLastChanged = Time.time - actionLastChanged;

                            if (timeSinceLastChanged < 1)
                            {
                                Color setColor = Color.Lerp(Color.green, defaultColor, timeSinceLastChanged);
                                GUI.backgroundColor = setColor;
                            }
                        }


                        if (action is SteamVR_Action_Boolean)
                        {
                            SteamVR_Action_Boolean actionBoolean = (SteamVR_Action_Boolean)action;
                            actionText = actionBoolean.GetState(source).ToString();
                        }
                        else if (action is SteamVR_Action_Single)
                        {
                            SteamVR_Action_Single actionSingle = (SteamVR_Action_Single)action;
                            actionText = actionSingle.GetAxis(source).ToString("0.0000");
                        }
                        else if (action is SteamVR_Action_Vector2)
                        {
                            SteamVR_Action_Vector2 actionVector2 = (SteamVR_Action_Vector2)action;
                            actionText = string.Format("({0:0.0000}, {1:0.0000})", actionVector2.GetAxis(source).x, actionVector2.GetAxis(source).y);
                        }
                        else if (action is SteamVR_Action_Vector3)
                        {
                            SteamVR_Action_Vector3 actionVector3 = (SteamVR_Action_Vector3)action;
                            Vector3 axis = actionVector3.GetAxis(source);
                            actionText = string.Format("({0:0.0000}, {1:0.0000}, {2:0.0000})", axis.x, axis.y, axis.z);
                        }
                        else if (action is SteamVR_Action_Pose)
                        {
                            SteamVR_Action_Pose actionPose = (SteamVR_Action_Pose)action;
                            Vector3             position   = actionPose.GetLocalPosition(source);
                            Quaternion          rotation   = actionPose.GetLocalRotation(source);
                            actionText = string.Format("({0:0.0000}, {1:0.0000}, {2:0.0000}) : ({3:0.0000}, {4:0.0000}, {5:0.0000}, {6:0.0000})",
                                                       position.x, position.y, position.z,
                                                       rotation.x, rotation.y, rotation.z, rotation.w);
                        }
                        else if (action is SteamVR_Action_Skeleton)
                        {
                            SteamVR_Action_Skeleton actionSkeleton = (SteamVR_Action_Skeleton)action;
                            Vector3    position = actionSkeleton.GetLocalPosition(source);
                            Quaternion rotation = actionSkeleton.GetLocalRotation(source);
                            actionText = string.Format("({0:0.0000}, {1:0.0000}, {2:0.0000}) : ({3:0.0000}, {4:0.0000}, {5:0.0000}, {6:0.0000})",
                                                       position.x, position.y, position.z,
                                                       rotation.x, rotation.y, rotation.z, rotation.w);
                        }
                        else if (action is SteamVR_Action_Vibration)
                        {
                            //SteamVR_Input_Action_Vibration actionVibration = (SteamVR_Input_Action_Vibration)action;

                            if (timeSinceLastChanged == -1)
                            {
                                actionText = "never used";
                            }

                            actionText = string.Format("{0:0} seconds since last used", timeSinceLastChanged);
                        }

                        EditorGUILayout.LabelField(action.GetShortName(), actionText, labelStyle);
                        GUI.backgroundColor = defaultColor;
                    }

                    EditorGUILayout.Space();
                }


                EditorGUI.indentLevel--;
            }

            EditorGUILayout.EndScrollView();
        }
 public static void Dynamic_InitializeInstanceActions()
 {
     Valve.VR.SteamVR_Input.__actions_default_in_InteractUI        = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_InteractUI")));
     Valve.VR.SteamVR_Input.__actions_default_in_Teleport          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_Teleport")));
     Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch         = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_GrabPinch")));
     Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_GrabGrip")));
     Valve.VR.SteamVR_Input.__actions_default_in_Pose              = ((SteamVR_Action_Pose)(SteamVR_Input_References.GetAction("__actions_default_in_Pose")));
     Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand  = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_default_in_SkeletonLeftHand")));
     Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_default_in_SkeletonRightHand")));
     Valve.VR.SteamVR_Input.__actions_default_in_Squeeze           = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_default_in_Squeeze")));
     Valve.VR.SteamVR_Input.__actions_default_out_Haptic           = ((SteamVR_Action_Vibration)(SteamVR_Input_References.GetAction("__actions_default_out_Haptic")));
     Valve.VR.SteamVR_Input.__actions_platformer_in_Move           = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_platformer_in_Move")));
     Valve.VR.SteamVR_Input.__actions_platformer_in_Jump           = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_platformer_in_Jump")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Steering            = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_buggy_in_Steering")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle            = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_buggy_in_Throttle")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Brake       = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_buggy_in_Brake")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Reset       = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_buggy_in_Reset")));
     Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Boool  = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_Wheelchair_in_Boool")));
     Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec1   = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_Wheelchair_in_Vec1")));
     Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec2   = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_Wheelchair_in_Vec2")));
     Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec3   = ((SteamVR_Action_Vector3)(SteamVR_Input_References.GetAction("__actions_Wheelchair_in_Vec3")));
     Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Pose   = ((SteamVR_Action_Pose)(SteamVR_Input_References.GetAction("__actions_Wheelchair_in_Pose")));
     Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Skelly = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_Wheelchair_in_Skelly")));
     Valve.VR.SteamVR_Input.actions = new Valve.VR.SteamVR_Action[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Boool,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec1,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec2,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec3,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Pose,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Skelly
     };
     Valve.VR.SteamVR_Input.actionsIn = new Valve.VR.SteamVR_Action_In[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Boool,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec1,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec2,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec3,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Pose,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Skelly
     };
     Valve.VR.SteamVR_Input.actionsOut = new Valve.VR.SteamVR_Action_Out[]
     {
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsVibration = new Valve.VR.SteamVR_Action_Vibration[]
     {
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsPose = new Valve.VR.SteamVR_Action_Pose[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Pose
     };
     Valve.VR.SteamVR_Input.actionsBoolean = new Valve.VR.SteamVR_Action_Boolean[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Boool
     };
     Valve.VR.SteamVR_Input.actionsSingle = new Valve.VR.SteamVR_Action_Single[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec1
     };
     Valve.VR.SteamVR_Input.actionsVector2 = new Valve.VR.SteamVR_Action_Vector2[]
     {
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec2
     };
     Valve.VR.SteamVR_Input.actionsVector3 = new Valve.VR.SteamVR_Action_Vector3[]
     {
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec3
     };
     Valve.VR.SteamVR_Input.actionsSkeleton = new Valve.VR.SteamVR_Action_Skeleton[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Skelly
     };
     Valve.VR.SteamVR_Input.actionsNonPoseNonSkeletonIn = new Valve.VR.SteamVR_Action_In[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Boool,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec1,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec2,
         Valve.VR.SteamVR_Input.__actions_Wheelchair_in_Vec3
     };
 }
 /// <summary>
 /// <strong>[Should not be called by user code]</strong> Sets up the internals of the action source before SteamVR has been initialized.
 /// </summary>
 public override void Preinitialize(SteamVR_Action wrappingAction, SteamVR_Input_Sources forInputSource)
 {
     base.Preinitialize(wrappingAction, forInputSource);
     vector3Action = (SteamVR_Action_Vector3)wrappingAction;
 }
示例#7
0
 public static void Dynamic_InitializeInstanceActions()
 {
     Valve.VR.SteamVR_Input.__actions_default_in_InteractUI            = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_InteractUI")));
     Valve.VR.SteamVR_Input.__actions_default_in_Teleport              = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_Teleport")));
     Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch             = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_GrabPinch")));
     Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip              = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_GrabGrip")));
     Valve.VR.SteamVR_Input.__actions_default_in_Pose                  = ((SteamVR_Action_Pose)(SteamVR_Input_References.GetAction("__actions_default_in_Pose")));
     Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand      = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_default_in_SkeletonLeftHand")));
     Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand     = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_default_in_SkeletonRightHand")));
     Valve.VR.SteamVR_Input.__actions_default_in_SqueezeLeft           = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_default_in_SqueezeLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_teleportUp            = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_teleportUp")));
     Valve.VR.SteamVR_Input.__actions_default_in_teleportDown          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_teleportDown")));
     Valve.VR.SteamVR_Input.__actions_default_in_SqueezeRight          = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_default_in_SqueezeRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_trackpadLeft          = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_default_in_trackpadLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_trackpadRight         = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_default_in_trackpadRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_touchingLeftTrackpad  = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_touchingLeftTrackpad")));
     Valve.VR.SteamVR_Input.__actions_default_in_touchingRightTrackpad = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_touchingRightTrackpad")));
     Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonLeft        = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_MenuButtonLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonRight       = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_MenuButtonRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadLeft         = ((SteamVR_Action_Vector3)(SteamVR_Input_References.GetAction("__actions_default_in_ScrollPadLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadRight        = ((SteamVR_Action_Vector3)(SteamVR_Input_References.GetAction("__actions_default_in_ScrollPadRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthLeft         = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadNorthLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadEastLeft          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadEastLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthLeft         = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadSouthLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadWestLeft          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadWestLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthRight        = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadNorthRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadEastRight         = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadEastRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthRight        = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadSouthRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadWestRight         = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadWestRight")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleLeft        = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadMiddleLeft")));
     Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleRight       = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_DPadMiddleRight")));
     Valve.VR.SteamVR_Input.__actions_default_out_Haptic               = ((SteamVR_Action_Vibration)(SteamVR_Input_References.GetAction("__actions_default_out_Haptic")));
     Valve.VR.SteamVR_Input.__actions_platformer_in_Move               = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_platformer_in_Move")));
     Valve.VR.SteamVR_Input.__actions_platformer_in_Jump               = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_platformer_in_Jump")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Steering                = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_buggy_in_Steering")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle                = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_buggy_in_Throttle")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Brake = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_buggy_in_Brake")));
     Valve.VR.SteamVR_Input.__actions_buggy_in_Reset = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_buggy_in_Reset")));
     Valve.VR.SteamVR_Input.actions = new Valve.VR.SteamVR_Action[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportUp,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportDown,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeRight,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadRight,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingLeftTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingRightTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonRight,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleRight,
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset
     };
     Valve.VR.SteamVR_Input.actionsIn = new Valve.VR.SteamVR_Action_In[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportUp,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportDown,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeRight,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadRight,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingLeftTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingRightTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonRight,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleRight,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset
     };
     Valve.VR.SteamVR_Input.actionsOut = new Valve.VR.SteamVR_Action_Out[]
     {
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsVibration = new Valve.VR.SteamVR_Action_Vibration[]
     {
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsPose = new Valve.VR.SteamVR_Action_Pose[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_Pose
     };
     Valve.VR.SteamVR_Input.actionsBoolean = new Valve.VR.SteamVR_Action_Boolean[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportUp,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportDown,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingLeftTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingRightTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleRight,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset
     };
     Valve.VR.SteamVR_Input.actionsSingle = new Valve.VR.SteamVR_Action_Single[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeRight,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle
     };
     Valve.VR.SteamVR_Input.actionsVector2 = new Valve.VR.SteamVR_Action_Vector2[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadRight,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering
     };
     Valve.VR.SteamVR_Input.actionsVector3 = new Valve.VR.SteamVR_Action_Vector3[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadRight
     };
     Valve.VR.SteamVR_Input.actionsSkeleton = new Valve.VR.SteamVR_Action_Skeleton[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand
     };
     Valve.VR.SteamVR_Input.actionsNonPoseNonSkeletonIn = new Valve.VR.SteamVR_Action_In[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportUp,
         Valve.VR.SteamVR_Input.__actions_default_in_teleportDown,
         Valve.VR.SteamVR_Input.__actions_default_in_SqueezeRight,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_trackpadRight,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingLeftTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_touchingRightTrackpad,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_MenuButtonRight,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollPadRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadNorthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadEastRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadSouthRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadWestRight,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleLeft,
         Valve.VR.SteamVR_Input.__actions_default_in_DPadMiddleRight,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Move,
         Valve.VR.SteamVR_Input.__actions_platformer_in_Jump,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Steering,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Throttle,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Brake,
         Valve.VR.SteamVR_Input.__actions_buggy_in_Reset
     };
 }
        private void OnGUI()
        {
            if (SteamVR_Input.actionSets == null)
            {
                EditorGUILayout.LabelField("Must first generate actions. Open SteamVR Input window.");
                return;
            }

            bool startUpdatingSourceOnAccess = SteamVR_Action.startUpdatingSourceOnAccess;

            SteamVR_Action.startUpdatingSourceOnAccess = false;

            if (labelStyle == null)
            {
                labelStyle = new GUIStyle(EditorStyles.textField);
                labelStyle.normal.background = Texture2D.whiteTexture;

                setLabelStyle                   = new GUIStyle(EditorStyles.label);
                setLabelStyle.wordWrap          = true;
                setLabelStyle.normal.background = Texture2D.whiteTexture;
            }

            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);

            Color defaultColor = GUI.backgroundColor;

            SteamVR_ActionSet[]     actionSets = SteamVR_Input.actionSets;
            SteamVR_Input_Sources[] sources    = SteamVR_Input_Source.GetAllSources();

            if (sourceFoldouts == null)
            {
                sourceFoldouts = new Dictionary <SteamVR_Input_Sources, bool>();
                setFoldouts    = new Dictionary <SteamVR_Input_Sources, Dictionary <string, bool> >();
                for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++)
                {
                    sourceFoldouts.Add(sources[sourceIndex], false);
                    setFoldouts.Add(sources[sourceIndex], new Dictionary <string, bool>());

                    for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++)
                    {
                        SteamVR_ActionSet set = actionSets[actionSetIndex];
                        setFoldouts[sources[sourceIndex]].Add(set.GetShortName(), true);
                    }
                }

                sourceFoldouts[SteamVR_Input_Sources.Any]       = true;
                sourceFoldouts[SteamVR_Input_Sources.LeftHand]  = true;
                sourceFoldouts[SteamVR_Input_Sources.RightHand] = true;
            }

            DrawMap();

            for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++)
            {
                SteamVR_Input_Sources source = sources[sourceIndex];
                sourceFoldouts[source] = EditorGUILayout.Foldout(sourceFoldouts[source], source.ToString());

                if (sourceFoldouts[source] == false)
                {
                    continue;
                }

                EditorGUI.indentLevel++;

                for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++)
                {
                    SteamVR_ActionSet set = actionSets[actionSetIndex];
                    bool   setActive      = set.IsActive(source);
                    string activeText     = setActive ? "Active" : "Inactive";
                    float  setLastChanged = set.GetTimeLastChanged();

                    if (setLastChanged != -1)
                    {
                        float timeSinceLastChanged = Time.realtimeSinceStartup - setLastChanged;
                        if (timeSinceLastChanged < 1)
                        {
                            Color blendColor = setActive ? Color.green : inactiveSetColor;
                            Color setColor   = Color.Lerp(blendColor, defaultColor, timeSinceLastChanged);
                            GUI.backgroundColor = setColor;
                        }
                    }

                    EditorGUILayout.BeginHorizontal();
                    setFoldouts[source][set.GetShortName()] = EditorGUILayout.Foldout(setFoldouts[source][set.GetShortName()], set.GetShortName());

                    EditorGUILayout.LabelField(activeText, labelStyle);

                    GUI.backgroundColor = defaultColor;
                    EditorGUILayout.EndHorizontal();

                    if (setFoldouts[source][set.GetShortName()] == false)
                    {
                        continue;
                    }

                    EditorGUI.indentLevel++;

                    for (int actionIndex = 0; actionIndex < set.allActions.Length; actionIndex++)
                    {
                        SteamVR_Action action = set.allActions[actionIndex];
                        if (source != SteamVR_Input_Sources.Any && action is SteamVR_Action_Skeleton)
                        {
                            continue;
                        }

                        bool isUpdating = action.IsUpdating(source);
                        bool inAction   = action is ISteamVR_Action_In;

                        bool noData = false;
                        if (inAction && isUpdating == false)
                        {
                            GUI.backgroundColor = Color.yellow;
                            noData = true;
                        }
                        else
                        {
                            bool actionBound = action.GetActiveBinding(source);
                            if (setActive == false)
                            {
                                GUI.backgroundColor = inactiveSetColor;
                            }
                            else if (actionBound == false)
                            {
                                GUI.backgroundColor = Color.red;
                                noData = true;
                            }
                        }

                        if (noData)
                        {
                            EditorGUILayout.LabelField(action.GetShortName(), "-", labelStyle);
                            GUI.backgroundColor = defaultColor;
                            continue;
                        }

                        float actionLastChanged = action.GetTimeLastChanged(source);

                        string actionText = "";

                        float timeSinceLastChanged = -1;

                        if (actionLastChanged != -1)
                        {
                            timeSinceLastChanged = Time.realtimeSinceStartup - actionLastChanged;

                            if (timeSinceLastChanged < 1)
                            {
                                Color setColor = Color.Lerp(Color.green, defaultColor, timeSinceLastChanged);
                                GUI.backgroundColor = setColor;
                            }
                        }


                        if (action is SteamVR_Action_Boolean)
                        {
                            SteamVR_Action_Boolean actionBoolean = (SteamVR_Action_Boolean)action;
                            actionText = actionBoolean.GetState(source).ToString();
                        }
                        else if (action is SteamVR_Action_Single)
                        {
                            SteamVR_Action_Single actionSingle = (SteamVR_Action_Single)action;
                            actionText = actionSingle.GetAxis(source).ToString("0.0000");
                        }
                        else if (action is SteamVR_Action_Vector2)
                        {
                            SteamVR_Action_Vector2 actionVector2 = (SteamVR_Action_Vector2)action;
                            actionText = string.Format("({0:0.0000}, {1:0.0000})", actionVector2.GetAxis(source).x, actionVector2.GetAxis(source).y);
                        }
                        else if (action is SteamVR_Action_Vector3)
                        {
                            SteamVR_Action_Vector3 actionVector3 = (SteamVR_Action_Vector3)action;
                            Vector3 axis = actionVector3.GetAxis(source);
                            actionText = string.Format("({0:0.0000}, {1:0.0000}, {2:0.0000})", axis.x, axis.y, axis.z);
                        }
                        else if (action is SteamVR_Action_Pose)
                        {
                            SteamVR_Action_Pose actionPose = (SteamVR_Action_Pose)action;
                            Vector3             position   = actionPose.GetLocalPosition(source);
                            Quaternion          rotation   = actionPose.GetLocalRotation(source);
                            actionText = string.Format("({0:0.0000}, {1:0.0000}, {2:0.0000}) : ({3:0.0000}, {4:0.0000}, {5:0.0000}, {6:0.0000})",
                                                       position.x, position.y, position.z,
                                                       rotation.x, rotation.y, rotation.z, rotation.w);
                        }
                        else if (action is SteamVR_Action_Skeleton)
                        {
                            SteamVR_Action_Skeleton actionSkeleton = (SteamVR_Action_Skeleton)action;
                            Vector3    position = actionSkeleton.GetLocalPosition(source);
                            Quaternion rotation = actionSkeleton.GetLocalRotation(source);
                            actionText = string.Format("({0:0.0000}, {1:0.0000}, {2:0.0000}) : ({3:0.0000}, {4:0.0000}, {5:0.0000}, {6:0.0000})",
                                                       position.x, position.y, position.z,
                                                       rotation.x, rotation.y, rotation.z, rotation.w);
                        }
                        else if (action is SteamVR_Action_Vibration)
                        {
                            //SteamVR_Input_Action_Vibration actionVibration = (SteamVR_Input_Action_Vibration)action;

                            if (timeSinceLastChanged == -1)
                            {
                                actionText = "never used";
                            }

                            actionText = string.Format("{0:0} seconds since last used", timeSinceLastChanged);
                        }

                        EditorGUILayout.LabelField(action.GetShortName(), actionText, labelStyle);
                        GUI.backgroundColor = defaultColor;
                    }

                    EditorGUI.indentLevel--;
                    EditorGUILayout.Space();
                }


                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Active Action Set List");
            EditorGUI.indentLevel++;
            EditorGUILayout.LabelField(SteamVR_ActionSet_Manager.debugActiveSetListText, setLabelStyle);
            EditorGUI.indentLevel--;

            EditorGUILayout.Space();

            EditorGUILayout.EndScrollView();

            SteamVR_Action.startUpdatingSourceOnAccess = startUpdatingSourceOnAccess;
        }
示例#9
0
 public static void Dynamic_InitializeInstanceActions()
 {
     Valve.VR.SteamVR_Input.__actions_default_in_InteractUI        = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_InteractUI")));
     Valve.VR.SteamVR_Input.__actions_default_in_Teleport          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_Teleport")));
     Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch         = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_GrabPinch")));
     Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_GrabGrip")));
     Valve.VR.SteamVR_Input.__actions_default_in_Pose              = ((SteamVR_Action_Pose)(SteamVR_Input_References.GetAction("__actions_default_in_Pose")));
     Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand  = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_default_in_SkeletonLeftHand")));
     Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand = ((SteamVR_Action_Skeleton)(SteamVR_Input_References.GetAction("__actions_default_in_SkeletonRightHand")));
     Valve.VR.SteamVR_Input.__actions_default_in_Squeeze           = ((SteamVR_Action_Single)(SteamVR_Input_References.GetAction("__actions_default_in_Squeeze")));
     Valve.VR.SteamVR_Input.__actions_default_in_VergroessernL     = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_VergroessernL")));
     Valve.VR.SteamVR_Input.__actions_default_in_VergroessernR     = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_VergroessernR")));
     Valve.VR.SteamVR_Input.__actions_default_in_BewegenL          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_BewegenL")));
     Valve.VR.SteamVR_Input.__actions_default_in_BewegenR          = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_BewegenR")));
     Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosL      = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_default_in_TrackpadPosL")));
     Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchL    = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_TrackpadTouchL")));
     Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosR      = ((SteamVR_Action_Vector2)(SteamVR_Input_References.GetAction("__actions_default_in_TrackpadPosR")));
     Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchR    = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_TrackpadTouchR")));
     Valve.VR.SteamVR_Input.__actions_default_in_ScrollWheel       = ((SteamVR_Action_Vector3)(SteamVR_Input_References.GetAction("__actions_default_in_ScrollWheel")));
     Valve.VR.SteamVR_Input.__actions_default_in_ShowControllerUIL = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_ShowControllerUIL")));
     Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetR     = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_SelectPlanetR")));
     Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetL     = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_SelectPlanetL")));
     Valve.VR.SteamVR_Input.__actions_default_in_Back              = ((SteamVR_Action_Boolean)(SteamVR_Input_References.GetAction("__actions_default_in_Back")));
     Valve.VR.SteamVR_Input.__actions_default_out_Haptic           = ((SteamVR_Action_Vibration)(SteamVR_Input_References.GetAction("__actions_default_out_Haptic")));
     Valve.VR.SteamVR_Input.actions = new Valve.VR.SteamVR_Action[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernL,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernR,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenL,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchR,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollWheel,
         Valve.VR.SteamVR_Input.__actions_default_in_ShowControllerUIL,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetR,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetL,
         Valve.VR.SteamVR_Input.__actions_default_in_Back,
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsIn = new Valve.VR.SteamVR_Action_In[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Pose,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand,
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernL,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernR,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenL,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchR,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollWheel,
         Valve.VR.SteamVR_Input.__actions_default_in_ShowControllerUIL,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetR,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetL,
         Valve.VR.SteamVR_Input.__actions_default_in_Back
     };
     Valve.VR.SteamVR_Input.actionsOut = new Valve.VR.SteamVR_Action_Out[]
     {
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsVibration = new Valve.VR.SteamVR_Action_Vibration[]
     {
         Valve.VR.SteamVR_Input.__actions_default_out_Haptic
     };
     Valve.VR.SteamVR_Input.actionsPose = new Valve.VR.SteamVR_Action_Pose[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_Pose
     };
     Valve.VR.SteamVR_Input.actionsBoolean = new Valve.VR.SteamVR_Action_Boolean[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernL,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernR,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenL,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchR,
         Valve.VR.SteamVR_Input.__actions_default_in_ShowControllerUIL,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetR,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetL,
         Valve.VR.SteamVR_Input.__actions_default_in_Back
     };
     Valve.VR.SteamVR_Input.actionsSingle = new Valve.VR.SteamVR_Action_Single[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze
     };
     Valve.VR.SteamVR_Input.actionsVector2 = new Valve.VR.SteamVR_Action_Vector2[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosR
     };
     Valve.VR.SteamVR_Input.actionsVector3 = new Valve.VR.SteamVR_Action_Vector3[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollWheel
     };
     Valve.VR.SteamVR_Input.actionsSkeleton = new Valve.VR.SteamVR_Action_Skeleton[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonLeftHand,
         Valve.VR.SteamVR_Input.__actions_default_in_SkeletonRightHand
     };
     Valve.VR.SteamVR_Input.actionsNonPoseNonSkeletonIn = new Valve.VR.SteamVR_Action_In[]
     {
         Valve.VR.SteamVR_Input.__actions_default_in_InteractUI,
         Valve.VR.SteamVR_Input.__actions_default_in_Teleport,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabPinch,
         Valve.VR.SteamVR_Input.__actions_default_in_GrabGrip,
         Valve.VR.SteamVR_Input.__actions_default_in_Squeeze,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernL,
         Valve.VR.SteamVR_Input.__actions_default_in_VergroessernR,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenL,
         Valve.VR.SteamVR_Input.__actions_default_in_BewegenR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchL,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadPosR,
         Valve.VR.SteamVR_Input.__actions_default_in_TrackpadTouchR,
         Valve.VR.SteamVR_Input.__actions_default_in_ScrollWheel,
         Valve.VR.SteamVR_Input.__actions_default_in_ShowControllerUIL,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetR,
         Valve.VR.SteamVR_Input.__actions_default_in_SelectPlanetL,
         Valve.VR.SteamVR_Input.__actions_default_in_Back
     };
 }