Exemplo n.º 1
0
        public ObjectInteractEventArgs SetControllerInteractEvent(GameObject target)
        {
            ObjectInteractEventArgs e;

            e.controllerIndex = VRTK_DeviceFinder.GetControllerIndex(gameObject);
            e.target          = target;
            return(e);
        }
Exemplo n.º 2
0
        public UIPointerEventArgs SetUIPointerEvent(GameObject currentTarget, GameObject lastTarget = null)
        {
            UIPointerEventArgs e;

            e.controllerIndex = VRTK_DeviceFinder.GetControllerIndex(controller.gameObject);
            e.isActive        = PointerActive();
            e.currentTarget   = currentTarget;
            e.previousTarget  = lastTarget;
            return(e);
        }
Exemplo n.º 3
0
        /// <summary>
        /// The ToggleBeam method allows the pointer beam to be toggled on or off via code at runtime. If true is passed as the state then the beam is activated, if false then the beam is deactivated.
        /// </summary>
        /// <param name="state">The state of whether to enable or disable the beam.</param>
        public virtual void ToggleBeam(bool state)
        {
            var index = VRTK_DeviceFinder.GetControllerIndex(gameObject);

            if (state)
            {
                TurnOnBeam(index);
            }
            else
            {
                TurnOffBeam(index);
            }
        }
Exemplo n.º 4
0
 private void Update()
 {
     controllerIndex = VRTK_DeviceFinder.GetControllerIndex(gameObject);
 }