Esempio n. 1
0
    private void OnPlayerDataLoaded(GetPlayerDataResponse response)
    {
        if (response.Values.Count == 0)
        {
            SkillLevel = 0;
        }
        else
        {
            SkillLevel = response.Values [0].Value.AsInt();
        }

        UnityEngine.Debug.Log("Loaded Skill Level:" + SkillLevel);

        OnPlayerLoggedIn(m_loggedInChilliConnectId);
    }
Esempio n. 2
0
    /// Handles the response of the get player team call from ChilliConnect. Will
    /// parse the team name and team id from the returned data and store against the
    /// current players team.
    ///
    /// @param response
    ///     The response of the GetPlayerDataCall from ChilliConnect
    ///
    private void OnPlayerTeamFetched(GetPlayerDataResponse response)
    {
        if (response.Values.Count > 0)
        {
            var key = response.Values [0].Value;
            if (key.IsDictionary())
            {
                var teamProperties = key.AsDictionary();

                var team = new Team();
                team.ID   = teamProperties.GetString("TeamID");
                team.Name = teamProperties.GetString("TeamName");

                PlayerTeam = team;
            }
        }

        OnPlayerTeamRefreshed(PlayerTeam);
    }