/// <summary> /// Handles the focus of the current object and of the last object /// </summary> /// <param name="focus"></param> public void Focus(bool focus) { _animator.SetBool(FOCUS_ANIMATION_PARAMETER, focus); if (focus && _lastFocus != null) { if (!_lastFocus.IsStayInFocus) { _lastFocus.Focus(false); _lastFocus = null; } } }
/// <summary> /// Calls Focus(true) method if stylus enters the gameobject. /// </summary> public void OnStylusEnter() { Focus(true); switch (_focusMode) { case FocusMode.StayInFocus: _lastFocus = this; break; case FocusMode.WaitForChange: _lastFocus = this; break; default: break; } }