Hi,
I created a UIButton and added a UIToggle script.
From another script attached on a camera I need to handle the click button to flash light on/off.
This is the script code portion but when I press the button the compiler not enter in event. Why?
Thanks
public class MenuFixedController : MonoBehaviour
{
UIToggle myFlashLightButton;
void Start()
{
myFlashLightButton = (UIToggle) GetComponentInChildren<UIToggle>().GetComponent("FlashButton");
EventDelegate delFlashLight = new EventDelegate (this, "OnFlashLightButtonChange");
EventDelegate.Set (myFlashLightButton.onChange, delFlashLight);
}
void OnFlashLightButtonChange(GameObject go)
{
// DO MY STUFF
}
}