Esempio n. 1
0
    public IEnumerator Initialization()
    {
        yield return(new WaitForSeconds(1.5f));

        GetLocationDataOfRubbish();
        yield return(new WaitForSeconds(0.5f));

        playerInfo = new PlayerInfo
        {
            PlayerUsername     = playerDataSaver.GetUsername(),
            PlayerPassword     = playerDataSaver.GetPassword(),
            PlayerEmail        = playerDataSaver.GetEmail(),
            PlayerCountry      = playerDataSaver.GetCountry(),
            PlayerAvatar       = playerDataSaver.GetAvatar(),
            PlayerRubbish      = playerDataSaver.GetWasteCollected(),
            PlayerRecycle      = playerDataSaver.GetRecycleCollected(),
            PlayerTeamName     = playerDataSaver.GetTeamname(),
            PlayerCoins        = playerDataSaver.GetCoinsAvailable(),
            PlayerCurrentLevel = playerDataSaver.GetProgressLevel(),
            RubbishPlace       = place,
            RubbishDistrict    = district,
            RubbishRegion      = region,
            RubbishCountry     = country,
        };
        GetPlayerStats();
        yield return(new WaitForSeconds(0.5f));

        GetPlayerData();
        yield return(new WaitForSeconds(5f));

        StartCoroutine(Leaderboards.Instance.GetWorldLeaderboardByCountry());
    }
Esempio n. 2
0
    private void Start()
    {
        string teamname = playerDataSaver.GetTeamname();

        if (teamname == "-")
        {
            teamnameSetterButton.gameObject.SetActive(true);
        }
        else
        {
            teamnameSetterButton.gameObject.SetActive(false);
        }
    }
Esempio n. 3
0
 public void SetPlayerData()
 {
     country  = playerDataSaver.GetCountry();
     avatar   = playerDataSaver.GetAvatar();
     teamname = playerDataSaver.GetTeamname();
     PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest()
     {
         Permission = UserDataPermission.Public,
         Data       = new Dictionary <string, string>()
         {
             { "Country", country },
             { "Avatar", avatar },
             { "Achievements", "0" },
             { "Tree Location", "-" },
             { "TeamName", "-" }
         }
     },
                                     result => Debug.Log("Successfully updated user data"),
                                     error =>
     {
         Debug.Log(error.GenerateErrorReport());
     });
 }
Esempio n. 4
0
 private void UpdatePlayerInfo()
 {
     playerInfo = new PlayerInfo
     {
         PlayerUsername     = playerDataSaver.GetUsername(),
         PlayerPassword     = playerDataSaver.GetPassword(),
         PlayerEmail        = playerDataSaver.GetEmail(),
         PlayerTeamName     = playerDataSaver.GetTeamname(),
         PlayerWaste        = playerDataSaver.GetWasteCollected(),
         PlayerRecycle      = playerDataSaver.GetRecycleCollected(),
         PlayerRubbish      = playerDataSaver.GetRubbishCollected(),
         PlayerCoins        = playerDataSaver.GetCoinsAvailable(),
         PlayerCurrentLevel = playerDataSaver.GetProgressLevel(),
         RubbishInPlace     = rubbishInPlace,
         RubbishInDistrict  = rubbishInDistrict,
         RubbishInRegion    = rubbishInRegion,
         RubbishInCountry   = rubbishInCountry,
         RubbishPlace       = place,
         RubbishDistrict    = district,
         RubbishRegion      = region,
         RubbishCountry     = country
     };
 }