/// <summary> /// Registers the command name and the associated Action in the DevCommand system, /// and also handles gesture detection for the provided GestureType in the /// DevCommandGesture system. /// </summary> public static void Register <GestureType>(string commandName, Action commandAction) where GestureType : IGesture { DevCommand.Register(commandName, commandAction); DevCommandGesturesManager.RegisterCommand <GestureType>(commandName); }
/// <summary> /// Registers the command name and the associated Action in the DevCommand system, /// and also handles gesture detection for the provided GestureType in the /// DevCommandGesture system. TwoHandedHeldGestures provide position data, so /// you can provide a command Action that takes a Vector3 as input. /// </summary> public static void Register <GestureType>(string commandName, Action <Vector3> actionWithGesturePosition) where GestureType : TwoHandedHeldGesture { DevCommand.Register(commandName, actionWithGesturePosition); DevCommandGesturesManager.RegisterPositionCommand <GestureType>(commandName); }
private static void RuntimeInitializeOnLoad() { DevCommand.Register("Recenter", () => { UnityEngine.XR.InputTracking.Recenter(); }); }