Example #1
0
 private static void AddButtonForOption(string option)
 {
     GameObject newButton = Instantiate(Resources.Load("FilterOption"), Vector2.zero, Quaternion.identity, buttonContainer) as GameObject;
     newButton.transform.localPosition = new Vector2(0f, 495f + (buttons.Count * -20f));
     newButton.transform.GetChild(0).GetComponent<Text>().text = option;
     newButton.GetComponent<Button>().onClick.AddListener(delegate { BattleReport.FilterReport(option); });
     buttons.Add(newButton);
 }