public VRIL_ControllerActionEventArgs(int controllerIndex, VRIL_ButtonType buttonType,
                                       VRIL_ButtonInteractionType interactionType, float buttonPressStrength)
 {
     ControllerIndex       = controllerIndex;
     ButtonType            = buttonType;
     ButtonInteractionType = interactionType;
     ButtonPressStrength   = buttonPressStrength;
 }
Example #2
0
        /// <summary>
        /// Notify manager with action event
        /// </summary>
        /// <param name="fromSource">Source input from SteamVR</param>
        /// <param name="vRIL_ButtonType">Specified VRIL ButtonType in Inspector</param>
        /// <param name="vRIL_ButtonInteractionType">Specified VRIL InteractionType in Inspector</param>
        public void NotifyControllerActionEvent(SteamVR_Input_Sources fromSource, VRIL_ButtonType vRIL_ButtonType, VRIL_ButtonInteractionType vRIL_ButtonInteractionType)
        {
            VRIL_ControllerActionEventArgs v = new VRIL_ControllerActionEventArgs
            {
                ButtonType            = vRIL_ButtonType,
                ButtonInteractionType = vRIL_ButtonInteractionType
            };

            if (fromSource == SteamVR_Input_Sources.LeftHand)
            {
                v.ControllerIndex = 0;
            }
            else if (fromSource == SteamVR_Input_Sources.RightHand)
            {
                v.ControllerIndex = 1;
            }
            manager.OnControllerAction(v);
        }