Beispiel #1
0
        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);
        }
Beispiel #2
0
        // Start is called before the first frame update
        void Start()
        {
            //Validate all the transform components
            ValidateComponent(leftController);
            ValidateComponent(rightController);
            ValidateComponent(headset);
            ValidateComponent(playArea);

            //get the VRcontrollerComponents from the relevant controller
            left  = leftController.GetComponent <VRController>();
            right = rightController.GetComponent <VRController>();

            left.Initialise();
            right.Initialise();
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public InputEventArgs(VRController _controller, SteamVR_Input_Sources _source, Vector2 _touchpadAxis)
 {
     controller   = _controller;
     source       = _source;
     touchpadAxis = _touchpadAxis;
 }
Beispiel #5
0
 public InputEventArgs(VRController controller, SteamVR_Input_Sources sources, Vector2 touchpadAxis)
 {
     this.controller   = controller;
     this.sources      = sources;
     this.touchpadAxis = touchpadAxis;
 }