Exemple #1
0
    private void CalculateLevel()
    {
        int accValue = prefsControl.GetAccumalitiveMoney();

        level.text     = "Level : " + (Mathf.FloorToInt(accValue / levelIndicator) + 1).ToString();
        firePower.text = "Level : " + prefsControl.GetFirePower();
        health.text    = "Level : " + prefsControl.GetMinimumHealth();
        multipler.text = "Level : " + prefsControl.GetMinimumMultipler();
        error.gameObject.SetActive(false);
        UpdateHordingValue();
    }
 // Use this for initialization
 void Start()
 {
     currentyGameState      = GAME_STATE.Playing;
     playerScore            = 0f;
     playerMultipler        = 1;
     playerPoints           = 100f; // Default Amount
     progressionTimer       = Time.timeSinceLevelLoad;
     progressionIncrementer = 0.8f;
     progressionCountdown   = 10f;
     bossTimer        = Time.timeSinceLevelLoad;
     bossCountdown    = 120f;
     currentSpawn     = SPAWN_NPC.Jeep;
     scoreDisplay     = GameObject.Find("Text_ScoreDisplay").GetComponent <Text>();
     multiDisplay     = GameObject.Find("Text_MultiplerDisplay").GetComponent <Text>();
     healthDisplay    = GameObject.Find("Text_HealthDisplay").GetComponent <Text>();
     audio            = GetComponents <AudioSource>();
     playerControl    = FindObjectOfType <PlayerController>();
     playerPrefs      = FindObjectOfType <PlayerPrefsControlScript>();
     minHealth        = playerPrefs.GetMinimumHealth();
     playerHealth    += minHealth;
     upgradedDamage   = playerPrefs.GetFirePower();
     playerDamage    += upgradedDamage;
     minMultiplier    = playerPrefs.GetMinimumMultipler();
     playerMultipler += minMultiplier;
     UpdateHUD();
 }