UI buttons getting selected by dialogue system
Posted: Tue Feb 22, 2022 10:20 am
Hello,
I'm having an issue with dialogue system. It seems to be selecting a previously selected button on specific occasions.
If I open a menu from a dialogue sequence (for example, if I talk to a shop owner, he has a couple of lines of dialogue then I activate a gameobject that opens a menu to buy/sell), after a random amount of time of about half a second, the selected button on my menu gets deselected. It renders my menu unusable.
If I debug the currently selected gameobject, I notice something is selecting a previously selected button. If I setup a OnSelect function on that button and debug the source of the selection, it's dialogue system.
When I print on select from Yes Button I get this error:
I'm having an issue with dialogue system. It seems to be selecting a previously selected button on specific occasions.
If I open a menu from a dialogue sequence (for example, if I talk to a shop owner, he has a couple of lines of dialogue then I activate a gameobject that opens a menu to buy/sell), after a random amount of time of about half a second, the selected button on my menu gets deselected. It renders my menu unusable.
If I debug the currently selected gameobject, I notice something is selecting a previously selected button. If I setup a OnSelect function on that button and debug the source of the selection, it's dialogue system.
When I print on select from Yes Button I get this error:
How can I avoid this?Yes button Selected
UnityEngine.Debug:LogError(Object)
ConfirmationOnSelect:UnityEngine.EventSystems.ISelectHandler.OnSelect(BaseEventData) (at Assets/Scripts/Debug/ConfirmationOnSelect.cs:9)
UnityEngine.EventSystems.EventSystem:SetSelectedGameObject(GameObject)
PixelCrushers.UIPanel:OnDisable() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIPanel.cs:190)
UnityEngine.GameObject:SetActive(Boolean)
PixelCrushers.UIPanel:OnHidden() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIPanel.cs:251)
PixelCrushers.<WaitForAnimation>d__13:MoveNext() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIAnimatorMonitor.cs:105)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)