Exemplo n.º 1
0
    private void JoinAvailableMatchCallBack(JoinAvailableMatchResponse response)
    {
        if (response.Success)
        {
            var matchObject = response.Match;
            if (matchObject.State != GameState.MATCHSTATE_READY)
            {
                UnityEngine.Debug.Log("INVALID MATCH STATE:" + matchObject.State);
            }

            SaveMatchId(matchObject.MatchId);

            CurrentGame.MatchId = matchObject.MatchId;
            CurrentGame.Update(matchObject);
            CurrentGame.OccupyEmptyPlayerPosition(m_chilliConnectId);

            StartMatch(matchObject.MatchId);

            OnMatchMakingSuceeded(CurrentGame);
        }
        else
        {
            OnMatchMakingFailed();
        }
    }