//basic singleton private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); return; } //validate all the transform comenants ValidateComponant(leftController); ValidateComponant(rightController); ValidateComponant(headset); ValidateComponant(playArea); //get the VR controller comements for the relavent controllers left = leftController.GetComponent <VRController>(); right = rightController.GetComponent <VRController>(); left.Initialised(); right.Initialised(); }
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); grab.AddOnStateDownListener(OnGrabDown, controller.InputSource); grab.AddOnStateUpListener(OnGrabUp, controller.InputSource); use.AddOnStateDownListener(OnUseDown, controller.InputSource); use.AddOnStateUpListener(OnUseUp, controller.InputSource); touchpadAxis.AddOnChangeListener(OnTouchpadChanged, controller.InputSource); }
public InputEventArgs(VRController _controller, SteamVR_Input_Sources _source, Vector2 _touchpadAxis) { controller = _controller; sources = _source; touchpadAxis = _touchpadAxis; }