Add/modify functions inside unity UI buttons through code[JS]

So i’d like to add/modify a function on a button but i can’t find any documentation on this. i’m aware you can add things via the inspector but i need to modify a function at runtime so this option doesn’t help me. is it possible to add/change a button’s functions in code? thanks for any suggestions!

note:using js but i can “translate” from c++ if need be.

You want to check out AddListener

1 Like