The suspension highlighting status such as Unity Button does not reset (Selectable)
Problem description
Causes
// Select on enable and add to the list. protected override void OnEnable() { base.OnEnable(); s_List.Add(this); var state = SelectionState.Normal; // The button will be highlighted even in some cases where it shouldn't. // For example: We only want to set the State as Highlighted if the StandaloneInputModule.m_CurrentInputMode == InputMode. Buttons // But we dont have access to this, and it might not apply to other InputModules. // TODO: figure out how to solve this. Case 617348. if (hasSelection) state = SelectionState.Highlighted; m_CurrentSelectionState = state; InternalEvaluateAndTransitionToSelectionState(true); }
var transitionState = m_CurrentSelectionState; if (IsActive() && ! IsInteractable()) transitionState = SelectionState.Disabled; DoStateTransition(transitionState, instant);
public virtual void OnSelect(BaseEventData eventData) { hasSelection = true; EvaluateAndTransitionToSelectionState(eventData); }
public virtual void OnDeselect(BaseEventData eventData) { hasSelection = false; EvaluateAndTransitionToSelectionState(eventData); }
resolvent
private void OnDisable(){ mBtn.OnDeselect(null); }