UnityAction + AddPersistentListener taking arguments
Hello, y want to send some arguments via AddPersistentListener with an UnityAction, but y cant resolve this thanks for the minimum unity docs and horrible minimalistic.
My code so far is this.
UnityEditor.Events.UnityEventTools.AddPersistentListener(currList.children[idChild].button.onClick, new UnityAction(currList.onChildClick(idChild)));
But UnityAction doesnt take the arguments, and y dont understand who create this.
Thanks for any suggestion.
Answer by Lord-Megabite · Feb 08, 2016 at 03:45 PM
Ok , the method y needed is : UnityEditor.Events.UnityEventTools.AddIntPersistentListener(currList.children[idChild].button.onClick, currList.onChildClick, idChild);
Your answer
![](https://koobas.hobune.stream/wayback/20220612063444im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
is it possible to reset Time.time 1 Answer
Can there be private images on a gameobject? Or something similar to it? Self-contained images? 0 Answers
Mute Toggle Not Staying On 2 Answers
Can't drag variables between different scenes 1 Answer
App or APK updates and persistent data (Save Games, items, etc...) 0 Answers