You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to access Events "OnToggled" and "OnUntoggled" of a PressableButton? #11812
I replaced all my toggles with the new PressableButton of the MRTK3. Before the update, I subscribed to "onValueChanged" of my Toggle element. Now this event does not exist anymore. The PressableButton offers "OnToggled" and "OnUntoggled" in the inspector. I cannot find the right way, to access these events in my code.
The docu talks about the StatefulInteractable. But even this class does not offer those events. I could use some help.
Activity
AMollis commentedon Feb 13, 2024
Use the
StatefulInteractable.IsToggledTimedFlagobject. Types ofTimedFlaghave anOnEnteredandOnExitedevent you can register to.https://learn.microsoft.com/en-us/dotnet/api/mixedreality.toolkit.statefulinteractable.istoggled?view=mrtkcore-3.0&viewFallbackFrom=mrtkuxcore-3.0#mixedreality-toolkit-statefulinteractable-istoggled
https://learn.microsoft.com/en-us/dotnet/api/mixedreality.toolkit.timedflag?view=mrtkcore-3.0