示例#1
0
 private void Start()
 {
     wasteCollected   = playerDataSaver.GetWasteCollected();
     recycleCollected = playerDataSaver.GetRecycleCollected();
     coinsAvailable   = playerDataSaver.GetCoinsAvailable();
     progressLevel    = playerDataSaver.GetProgressLevel();
     rubbishCoroutine = RubbishCooldown();
 }
示例#2
0
 public void EnableCards()
 {
     coins = playerDataSaver.GetCoinsAvailable();
     foreach (var crd in cards)
     {
         if (coins >= Convert.ToInt32(crd.text))
         {
             crd.GetComponentInParent <Button>().interactable = true;
         }
         else if (coins < Convert.ToInt32(crd.text))
         {
             crd.GetComponentInParent <Button>().interactable = false;
         }
     }
 }
示例#3
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());
    }
示例#4
0
    public void ReductionUsed()
    {
        int newCoins = playerDataSaver.GetCoinsAvailable() - sliderController.coinsUsed;

        playerDataSaver.SetCoinsAvailable(newCoins);
        PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest()
        {
            FunctionName      = "UpdatePlayerCoins",
            FunctionParameter = new
            {
                cloudCoinsAvailable = newCoins
            },
            GeneratePlayStreamEvent = true,
        },
                                            result => Debug.Log("Sent " + newCoins + " coins to cloudscript"),
                                            error => Debug.Log(error.GenerateErrorReport()));
        OnValuesAdjusted(newCoins);
        sliderController.ResetSlider();
    }
示例#5
0
 private void Awake()
 {
     playerDataSaver = GetComponent <PlayerDataSaver>();
     btn             = GetComponent <Button>();
     coins           = playerDataSaver.GetCoinsAvailable();
 }