- Home /
Question by
Kiamo · Oct 08, 2017 at 01:37 PM ·
c#scripting problemuibutton
Scripting button functionality inside class with created object's method
Hi,
I'm trying to control a button's functionality inside a script (of a class->Player). I've created a factory-object inside this class which contains methods, i'm trying to pass these methods to the buttons using onClick.AddListener(). It seems these methods aren't added to the button's OnClick method. Is this because i'm using a created object's methods? The buttons show up normally and there's no reference issue -> using Find and GetComponent to access the buttons.
Comment
Best Answer
Answer by Kiamo · Oct 08, 2017 at 02:06 PM
For some magical reason, it now works after i used a Debug.Log() inside the method i was trying to call with the button.... i have wasted hours for nothing it seems.