Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

Toggle OnValueChanged Parameter Doesn't Change

$
0
0
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?

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>