Toggle点击事件
Toggle点击事件
public class Demo : MonoBehaviour { private Toggle toggle; void Start () { toggle.onValueChanged.AddListener((bool isOn)=> { OnToggleClick(toggle,isOn); }); } private void OnToggleClick(Toggle toggle,bool isOn) { //TODO } }
public class Demo : MonoBehaviour { private Toggle toggle; void Start () { toggle.onValueChanged.AddListener((bool isOn)=> { OnToggleClick(toggle,isOn); }); } private void OnToggleClick(Toggle toggle,bool isOn) { //TODO } }