Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Start () {
- for(int i = 0; i < 5; i++)
- {
- GameObject goButton = (GameObject)Instantiate(prefabButton);
- goButton.transform.SetParent(ParentPanel, false);
- goButton.transform.localScale = new Vector3(1, 1, 1);
- Button tempButton = goButton.GetComponent<Button>();
- int tempInt = i;
- tempButton.onClick.AddListener(() => ButtonClicked(tempInt));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement