예제 #1
0
    public WinnersScreen(GameObject gameObject, UnityAction onEndClick)
        : base(gameObject)
    {
        Transform playersRoot = Root.transform.FindChild("players");

        players = new List <WinnersItem>();
        for (int i = 0; i < playersRoot.childCount; i++)
        {
            WinnersItem item = new WinnersItem(playersRoot.GetChild(i).gameObject);
            players.Add(item);
            item.hide();
        }

        endButton = Root.transform.FindChild("buttonEnd").GetComponent <Button>();
        endButton.onClick.AddListener(onEndClick);
    }
예제 #2
0
    public WinnersScreen(GameObject gameObject, UnityAction onEndClick)
        : base(gameObject)
    {
        Transform playersRoot = Root.transform.FindChild("players");
        players = new List<WinnersItem>();
        for (int i = 0; i < playersRoot.childCount; i++)
        {
            WinnersItem item = new WinnersItem(playersRoot.GetChild(i).gameObject);
            players.Add(item);
            item.hide();
        }

        endButton = Root.transform.FindChild("buttonEnd").GetComponent<Button>();
        endButton.onClick.AddListener(onEndClick);
    }