Example #1
0
 private void HandleActionInvitationAccepted(UM_TBM_MatchResult result)
 {
     if (result.IsSucceeded)
     {
         MatchPanelUI panel = CreateNewMatchPanel(result.Match.Status == UM_TBM_MatchStatus.Ended ? FinishedMatchesHolder : ActiveMatchesHolder);
         panel.SetMatchInfo(result.Match);
         if (!matchUIs.ContainsKey(result.Match.Id))
         {
             matchUIs.Add(result.Match.Id, panel);
         }
     }
 }
Example #2
0
    private MatchPanelUI CreateNewMatchPanel(RectTransform parent)
    {
        MatchPanelUI newPanel = Instantiate(MatchPanelUI);

        newPanel.gameObject.SetActive(true);
        newPanel.transform.SetParent(parent.transform);
        newPanel.transform.localScale = Vector3.one;
        newPanel.AttachToParent(this);

        MatchList.Add(newPanel);

        return(newPanel);
    }
Example #3
0
    private void HandleActionMatchesInfoLoaded(UM_TBM_MatchesLoadResult res)
    {
        if (res.IsFailed)
        {
            return;
        }

        foreach (UM_TBM_Invite iinvite in TBM.Matchmaker.Invitations)
        {
            TBM.Matchmaker.AcceptInvite(iinvite);
        }

        foreach (UM_TBM_Match mmatch in TBM.Matchmaker.Matches)
        {
            MatchPanelUI panel = CreateNewMatchPanel(mmatch.Status == UM_TBM_MatchStatus.Ended ? FinishedMatchesHolder : ActiveMatchesHolder);
            panel.SetMatchInfo(mmatch);
            if (!matchUIs.ContainsKey(mmatch.Id))
            {
                matchUIs.Add(mmatch.Id, panel);
            }
        }
    }