2017-05-28から1日間の記事一覧
If you want to use AddListener and void function, you should not write like ``` button.onClick.AddListener (someFunction(id)); ``` but ``` button.onClick.AddListener (() => someFunction(id)); ```
Refer to doc. https://docs.unity3d.com/jp/current/ScriptReference/Events.UnityEventBase.RemoveAllListeners.html It says that RemoveAllListeners can only remove listeners attached at runtime.