Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 void Update()
 {
     if (gesture.wasFinished)
     {
         DevCommand.Invoke(devCommandName);
     }
 }
 void Update()
 {
     if (gesture.wasFinished)
     {
         DevCommand.Invoke(devCommandName, gesture.pose.position);
     }
 }
Exemplo n.º 5
0
 private static void RuntimeInitializeOnLoad()
 {
     DevCommand.Register("Recenter", () => { UnityEngine.XR.InputTracking.Recenter(); });
 }