Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

How to add non-persistent UnityAction with a single parameter to a button's OnClick event?

$
0
0
Title.

As far as I can tell this is impossible since I am unallowed to pass a typed UnityAction to the AddListener method in OnClick, and I'm not allowed to replace OnClick with my own extended UnityEvent class.

The reason why I'm doing this is because I'm creating a node-based dialog system for my game, and I want to procedurally create the choice buttons, clicking on the choice button would then call a static function and pass and int value that was assigned to it on Instantstiation to...

How to add non-persistent UnityAction with a single parameter to a button's OnClick event?

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>