So if we want to remove 1 listener event without parameter, then we can use it
UnityEngine.Events.UnityAction action = () => { myMethod(); myOtherMethod(); };
myButton.Getcomponent<Button>().onClick.AddListener(action);
myButton.Getcomponent().onClick.RemoveListener(action);
But the problem I can't do that with an even which have parameter. Something like
tempGO.GetComponent<Button>().onClick.AddListener(()=>onCollectItemClick(tempGO));
I can't save a point to this delegate because...
Remove only 1 Button click Event which have optional parameter
UnityEngine.Events.UnityAction action = () => { myMethod(); myOtherMethod(); };
myButton.Getcomponent<Button>().onClick.AddListener(action);
myButton.Getcomponent().onClick.RemoveListener(action);
But the problem I can't do that with an even which have parameter. Something like
tempGO.GetComponent<Button>().onClick.AddListener(()=>onCollectItemClick(tempGO));
I can't save a point to this delegate because...
Remove only 1 Button click Event which have optional parameter