/// <summary> /// a public way to set state directly /// </summary> /// <param name="state"></param> /// <param name="value"></param> public void SetState(InteractableStates.InteractableStateEnum state, bool value) { if (StateManager != null) { StateManager.SetStateValue(state, value ? 1 : 0); } UpdateState(); }
/// <summary> /// Handle focus state changes /// </summary> /// <param name="focus"></param> public virtual void SetFocus(bool focus) { HasFocus = focus; if (!focus && HasPress) { rollOffTimer = 0; } else { rollOffTimer = rollOffTime; } StateManager.SetStateValue(InteractableStates.InteractableStateEnum.Focus, focus ? 1 : 0); UpdateState(); }