I’m trying to create a simple option toggle with the Toggle component. When I hook up a callback for OnValueChanged and run the game, I noticed that the callback always receives whatever value I set in the Toggle window in the inspector - either true or false?
public void OnToggle(bool selected)
{
Debug.Log(selected);
}
Isn’t the callback supposed to pass the current value of the toggle itself, not a constant boolean value?
Can someone confirm that it actually works?
I have a simple toggle button that calls on the event “OnValueChanged” a call a GameObject.SetActive in dynamic mode and it doesn’t work. If I use the static mode it does work.
Unity 2019.3.0f6
Edit: It won’t work if fast play mode is enabled. It has to go through the normal full Domain/Scene etc reload when hitting play.