void OnClickBtn(ButtonScript obj, object args, int param1, int param2) { List <TemplteData> tdata = TemplteData.GetData(); _Input.value = tdata[param1]._Text; _DeTextObj.SetActive(false); }
void AddItem() { ClearObj(); List <TemplteData> tdata = TemplteData.GetData(); for (int i = 0; i < tdata.Count; i++) { GameObject go = GameObject.Instantiate(_Item) as GameObject; go.SetActive(true); go.transform.parent = _Grid.transform; go.transform.localScale = Vector3.one; DefText dtext = go.GetComponent <DefText>(); dtext.Tdata = tdata[i]; UIManager.SetButtonEventHandler(go, EnumButtonEvent.OnClick, OnClickBtn, i, 0); _Grid.repositionNow = true; } }