My prefab containing UIButton and onClick notify with target where i want the object clicked in one of many to be passed to a target. Unity removes the on click information from the prefab after the first use. This was answered on another message but that did not include a parameter. How do i code it with a parameter?
table[i] = (GameObject) Instantiate( Resources.Load( "Prefabs/NGUI/Table/tabledef_basic"));
EventDelegate.Add( table[i].GetComponent<UIButton>().onClick, FixturesPressed);
EventDelegate.Parameter = table[i];
public void FixturesPressed(GameObject go){
Debug.Log ( go.name + " clicked!");
}
The compiler generates
error CS1502: The best overloaded method match for `EventDelegate.Add(System.Collections.Generic.List<EventDelegate>, EventDelegate)' has some invalid arguments
Error CS1503: Argument `#2' cannot convert `method group' expression to type `EventDelegate'
It works fine without a parameter but i need a parameter. Can anyone help ? Thanks