/// <summary> /// Reset all parameters to their default values /// </summary> public void ResetParameters() { UseGaze = false; DefaultDistance = 200.0f; UseNormal = true; ReticleSize = Vector3.one; GazeExclusionLayer = 0; ReticleColor = Color.red; ReticleTargetColor = Color.red; GazePointerState = EPointerState.ON; ColorOnReticleBackgroud = Color.blue; ColorOnReticleTarget = Color.blue; ColorOffReticleBackgroud = Color.red; ColorOffReticleTarget = Color.red; ColorSelectableReticleBackgroud = Color.green; ColorSelectableReticleTarget = Color.green; UseDifferentStates = false; GazeButtonOVR = EControllersInput.NONE; GazeButtonOpenVR = EControllersInput.NONE; GazeButtonSimulator = EControllersInput.NONE; }
//EMPTY #region PUBLIC_METHODS #endregion #region PRIVATE_METHODS /// <summary> /// Check if the pointer is touching the UI /// </summary> /// <param name="isOver">If the Raycast is over something</param> /// <param name="pointerState">The current state of the pointer</param> /// <param name="pointer">The linerenderer to which the material is attached</param> /// <returns>The new state of the pointer</returns> private EPointerState CheckPointer(BoolVariable isOver, EPointerState pointerState, LineRenderer pointer, EHand hand) { Color on = Color.white; Color off = Color.white; Color selectable = Color.white; GetColor(hand, ref on, ref off, ref selectable); // If the pointer is supposed to be off if (pointerState == EPointerState.OFF) { pointer.material.color = off; return(EPointerState.OFF); } // If the pointer is not over something and it's state is not On else if (!isOver.Value && pointerState != EPointerState.ON) { pointer.material.color = on; return(EPointerState.ON); } // If the pointer is over something and it's state is not at Selectable else if (isOver.Value && pointerState != EPointerState.SELECTABLE) { pointer.material.color = selectable; return(EPointerState.SELECTABLE); } return(pointerState); }