Example #1
0
    public void OpenMatch(ItemMatch _itemMatch)
    {
        currentItemMatch    = _itemMatch;
        textMatchTitle.text = _itemMatch.GetMatch().date.ToShortDateString();

        //GENERAL
        textDuration.text   = _itemMatch.GetMatch().duration.Minutes.ToString("00") + ":" + _itemMatch.GetMatch().duration.Seconds.ToString("00");
        textGoalsAlly.text  = _itemMatch.GetMatch().GetNGoalsAlly().ToString();
        textGoalsEnemy.text = _itemMatch.GetMatch().GetNGoalsEnemy().ToString();
        textFouls.text      = _itemMatch.GetMatch().GetNFouls().ToString();
        textYellows.text    = _itemMatch.GetMatch().GetNYellows().ToString();
        textReds.text       = _itemMatch.GetMatch().GetNReds().ToString();

        //EVENTS
        for (int i = 0; i < parentItemEvents.childCount; i++)
        {
            Destroy(parentItemEvents.GetChild(i).gameObject);
        }

        for (int i = 0; i < _itemMatch.GetMatch().events.Count; i++)
        {
            ItemEvent ie = Instantiate(prefabItemEvent, parentItemEvents);
            ie.StartThis(_itemMatch.GetMatch().events[i]);
        }

        //PLAYERS
        for (int i = 0; i < parentItemPlayers.childCount; i++)
        {
            Destroy(parentItemPlayers.GetChild(i).gameObject);
        }

        for (int i = 0; i < _itemMatch.GetMatch().GetNPlayers(); i++)
        {
            ItemPlayerHistory ie = Instantiate(prefabItemPlayer, parentItemPlayers);
            ie.StartThis(_itemMatch.GetMatch().GetPlayer(i));
        }

        ButtonGeneral();

        MUI.GoRight(panelMatchProfile);
    }