// Start is called before the first frame update void Start() { MovePlayer.AddOnChangeListener(OnChangeMovePlayer, handTypeMove); PlaceMarker.AddOnChangeListener(OnChangePlace, handTypeMarker); ChooseMarker.AddOnChangeListener(OnChangeChoose, handTypeMove); ResizeMarker.AddOnChangeListener(OnChangeResize, handTypeMarker); }
// Start is called before the first frame update void Start() { trackpadMovement.AddOnChangeListener(OnTrackpadChange, handType); trackpadMovement.AddOnAxisListener(OnAxisChange, handType); trackpadMovement.AddOnUpdateListener(OnUpdate, handType); triggerClick.AddOnStateDownListener(OnTriggerStateDown, handType); }
// Start is called before the first frame update private void Start() { boost.AddOnChangeListener(ActionBoostChange, SteamVR_Input_Sources.LeftHand); forwardThrust.AddOnChangeListener(ActionForwardThrustChange, SteamVR_Input_Sources.LeftHand); hvThrust.AddOnChangeListener(ActionHvThrustChange, SteamVR_Input_Sources.LeftHand); grabJoystick.AddOnChangeListener(ActionGrabJoystickChange, SteamVR_Input_Sources.RightHand); uiEnter.AddOnChangeListener(ActionUiEnterChange, SteamVR_Input_Sources.RightHand); uiBack.AddOnChangeListener(ActionUiBackChange, SteamVR_Input_Sources.RightHand); pitchRoll.AddOnChangeListener(ActionPitchRollChange, SteamVR_Input_Sources.RightHand); gripLeft.AddOnChangeListener(ActionGripLeftChange, SteamVR_Input_Sources.LeftHand); gripRight.AddOnChangeListener(ActionGripRightChange, SteamVR_Input_Sources.RightHand); }
public void Initialise(VRController _controller) { controller = _controller; pointer.AddOnStateDownListener(OnPointerDown, controller.InputSource); pointer.AddOnStateUpListener(OnPointerUp, controller.InputSource); teleport.AddOnStateDownListener(OnTeleportDown, controller.InputSource); teleport.AddOnStateUpListener(OnTeleportUp, controller.InputSource); use.AddOnStateDownListener(OnUseDown, controller.InputSource); use.AddOnStateUpListener(OnUseUp, controller.InputSource); grab.AddOnStateDownListener(OnGrabDown, controller.InputSource); grab.AddOnStateUpListener(OnGrabUp, controller.InputSource); touchpadAxis.AddOnChangeListener(OnTouchpadChanged, controller.InputSource); }
public void Initialise(VrController _controller)// => controller = _controller; { Controller = _controller; pointer.AddOnStateDownListener(OnPointerDown, Controller.InputSource); pointer.AddOnStateUpListener(OnPointerUp, Controller.InputSource); teleport.AddOnStateDownListener(OnTeleportDown, Controller.InputSource); teleport.AddOnStateUpListener(OnTeleportUp, Controller.InputSource); interact.AddOnStateDownListener(OnInteractDown, Controller.InputSource); interact.AddOnStateUpListener(OnInteractUp, Controller.InputSource); grab.AddOnStateDownListener(OnGrabDown, Controller.InputSource); grab.AddOnStateUpListener(OnGrabUp, Controller.InputSource); touchpadAxis.AddOnChangeListener(OnTouchpadChanged, Controller.InputSource); }
// initialize objects void OnEnable() { // get hand hand = this.GetComponent <Hand>(); // create line l = new LineDrawer(); // get actions PlayAction.AddOnChangeListener(onPlay, hand.handType); PullAction.AddOnChangeListener(onPull, hand.handType); GrabAction.AddOnChangeListener(onGrab, hand.handType); RotationAction.AddOnChangeListener(onRotate, hand.handType); // set default color currColor = Color.blue; showLine = true; }
public void Initialise(VrController _controller) { controller = _controller; SteamVR_Input_Sources inputSource = controller.InputSource; #region delegate pointer.AddOnStateDownListener(OnPointerDown, inputSource); pointer.AddOnStateUpListener(OnPointerUp, inputSource); teleport.AddOnStateDownListener(OnTeleportDown, inputSource); teleport.AddOnStateUpListener(OnTeleportUp, inputSource); interact.AddOnStateDownListener(OnInteractDown, inputSource); interact.AddOnStateUpListener(OnInteractUp, inputSource); grab.AddOnStateDownListener(OnGrabDown, inputSource); grab.AddOnStateUpListener(OnGrabUp, inputSource); touchpadAxis.AddOnChangeListener(OnTouchpadChanged, inputSource); #endregion }
public void Initialise(VrCtrl _controller) { controller = _controller; //Specify to link to a specific input source pointer.AddOnStateDownListener(OnPointerDown, controller.InputSource); pointer.AddOnStateUpListener(OnPointerUp, controller.InputSource); teleport.AddOnStateDownListener(OnTeleportDown, controller.InputSource); teleport.AddOnStateUpListener(OnTeleportUp, controller.InputSource); interact.AddOnStateDownListener(OnInteractDown, controller.InputSource); interact.AddOnStateUpListener(OnInteractUp, controller.InputSource); grab.AddOnStateDownListener(OnGrabDown, controller.InputSource); grab.AddOnStateUpListener(OnGrabUp, controller.InputSource); touchPadAxis.AddOnChangeListener(OnTouchPadChanged, controller.InputSource); }
public void Initialise(VRController _controller) { controller = _controller; //Link callback to the steam events pointer.AddOnStateDownListener(OnPointerDown, controller.InputSource); pointer.AddOnStateUpListener(OnPointerUp, controller.InputSource); teleport.AddOnStateDownListener(OnTeleportDown, controller.InputSource); teleport.AddOnStateUpListener(OnTeleportUp, controller.InputSource); interact.AddOnStateDownListener(OnInteractDown, controller.InputSource); interact.AddOnStateUpListener(OnInteractUp, controller.InputSource); grab.AddOnStateDownListener(OnGrabDown, controller.InputSource); grab.AddOnStateUpListener(OnGrabUp, controller.InputSource); touchpadAxis.AddOnChangeListener(OnTouchpadChanged, controller.InputSource); OnGrabPressed.AddListener((args) => Dummy()); //OnGrabPressed += Dummy; //pointer.AddOnStateDownListener( // (SteamVR_Action_Boolean action, SteamVR_Input_Sources source) => onGrabPressed.Invoke(GenerateArgs()), // controller.InputSource); }