Esempio n. 1
0
 private void Start()
 {
     wasteCollected   = playerDataSaver.GetWasteCollected();
     recycleCollected = playerDataSaver.GetRecycleCollected();
     coinsAvailable   = playerDataSaver.GetCoinsAvailable();
     progressLevel    = playerDataSaver.GetProgressLevel();
     rubbishCoroutine = RubbishCooldown();
 }
Esempio n. 2
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. 3
0
    private IEnumerator StartBattle()
    {
        battlePanel.SetActive(true);
        battleText.text = "Prepare to battle...";
        yield return(new WaitUntil(() => enemyScript.isReadyToBattle == true));


        shieldUsed          = playerDataSaver.GetShieldUsed();
        shieldAvailable     = playerDataSaver.GetRecycleCollected() - shieldUsed;
        projectileUsed      = playerDataSaver.GetProjectileUsed();
        projectileAvailable = playerDataSaver.GetWasteCollected() - projectileUsed;
        attackAmount.text   = projectileAvailable.ToString();
        shieldAmount.text   = shieldAvailable.ToString();

        currentState = BattleState.PlayerTurn;
        PlayerTurn();
    }
Esempio n. 4
0
 private void Awake()
 {
     playerDataSaver        = GetComponent <PlayerDataSaver>();
     wasteToUnlockCounter   = playerDataSaver.GetWasteCollected();
     recycleToUnlockCounter = playerDataSaver.GetRecycleCollected();
     tasks = playerDataSaver.GetTasks();
     CheckForLocations();
     GetAchievementsFromData();
 }
Esempio n. 5
0
    public void Filling()
    {
        int rub = playerDataSaver.GetWasteCollected() + playerDataSaver.GetRecycleCollected();
        int lvl = playerDataSaver.GetProgressLevel();
        int max = levelRubbishCombo[lvl + 1];
        int min = levelRubbishCombo[lvl];

        levelSlider.maxValue = max;
        levelSlider.minValue = min;

        levelSlider.value = rub;
    }