void Start() { //Validate everything ValidateComponent(leftController); ValidateComponent(rightController); ValidateComponent(headset); ValidateComponent(playArea); //get the controller components left = leftController.GetComponent <VrController>(); right = rightController.GetComponent <VrController>(); //Initialise the controllers left.Initialise(); right.Initialise(); }
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 }
/// <summary> /// Contruct this pls. /// </summary> public InputEventArgs(VrController _controller, SteamVR_Input_Sources _source, Vector2 _touchpadAxis) { controller = _controller; source = _source; touchpadAxis = _touchpadAxis; }