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); }
private void Awake() { // Valitate all the transform components, aka Small-Brain-Proofing. ValidateComponent(leftController); ValidateComponent(rightController); ValidateComponent(headset); ValidateComponent(playArea); // Get the VrController components from the relevant controllers. left = leftController.GetComponent <VrController>(); right = rightController.GetComponent <VrController>(); // Initialise the two controllers; left.Initialise(); right.Initialise(); }
public InputEventArgs(VrController _controller, SteamVR_Input_Sources _source, Vector2 _touchpadAxis) { controller = _controller; source = _source; touchpadAxis = _touchpadAxis; }