Hi readers,
I have a problem that when I tried to instantiate NGUI sprite button prefab with scene object with script assigned to its UIbutton script under "notify". The link to the script in "notify" area is gone after being instantiated as a clone.
See the pictures for information.
I also tried to use the script I created to assign the object in scene to the UIButton script of the clones, but there are errors.
Here are the partial scripts attached to the buttons that I've tried:
1.) public GameObject lol;
void Start()
{
lol = GameObject.Find ("CCTVTableController");
gameObject.GetComponent<UIButton> ().onClick.Add (lol);
}
2.) gameObject.GetComponent<UIButton>().onClick.Add(GameObject.Find("CCTVTableController"));
Am I doing it wrong? Is there any better way that I can do it? Because I need to instantiate the buttons based on the number of CCTV services available that I can get from server.
Thanks
