コード例 #1
0
        public ObjectInteractEventArgs SetControllerInteractEvent(GameObject target)
        {
            ObjectInteractEventArgs e;

            e.controllerIndex = VRTK_DeviceFinder.GetControllerIndex(gameObject);
            e.target          = target;
            return(e);
        }
コード例 #2
0
ファイル: VRTK_UIPointer.cs プロジェクト: JesseHolwell/vRPG
        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);
        }
コード例 #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);
            }
        }
コード例 #4
0
 private void Update()
 {
     controllerIndex = VRTK_DeviceFinder.GetControllerIndex(gameObject);
 }