// Use this for initialization
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetMasterDifficulty();
     DisplayDifficulty();
     DisplayVolume();
 }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     lives     = baseLives - PlayerPrefsController.GetMasterDifficulty();
     livesText = GetComponent <Text>();
     UpdateDisplay();
     //Debug.Log("difficulty setting currently is " + PlayerPrefsController.GetMasterDifficulty());
 }
예제 #3
0
    private void SetSpawnDelay()
    {
        float difficultyFactor = (PlayerPrefsController.GetMasterDifficulty() * 2);

        minSpawnDelay -= difficultyFactor;
        maxSpawnDelay -= difficultyFactor;
    }
예제 #4
0
 void Start()
 {
     currentTime           = Mathf.Round(levelTimeInSeconds * PlayerPrefsController.GetMasterDifficulty());
     timerImage            = GetComponent <Image>();
     timerImage.fillAmount = 1.0f;
     timerText.text        = (levelTimeInSeconds.ToString("#") + "s");
 }
예제 #5
0
파일: Attacker.cs 프로젝트: ajf412/LaneGame
 private void Start()
 {
     difficulty = PlayerPrefsController.GetMasterDifficulty();
     animator   = GetComponent <Animator>();
     Debug.Log(gameObject.name + " initial damage: " + damage);
     damage *= difficulty;
     Debug.Log(gameObject.name + " difficulty damage: " + damage);
 }
예제 #6
0
    private void SetHealthForDifficulty()
    {
        Debug.Log(PlayerPrefsController.GetMasterDifficulty());
        int difficultyFactor = (Mathf.RoundToInt(PlayerPrefsController.GetMasterDifficulty() * 5));

        Debug.Log(difficultyFactor);
        playerHealth -= difficultyFactor;
    }
예제 #7
0
    // Start is called before the first frame update
    IEnumerator Start()
    {
        numberOfSpawns = PlayerPrefsController.GetMasterDifficulty();

        int currentSpawn = 0;

        do
        {
            yield return(StartCoroutine(SpawnEnemy()));

            currentSpawn++;
            if (currentSpawn >= numberOfSpawns)
            {
                spawn = false;
            }
        }while (spawn);
    }
예제 #8
0
    // Start is called before the first frame update
    void Start()
    {
        volumeOption         = transform.Find("Volume/VolumeSlider").gameObject;
        difficultyOption     = transform.Find("Difficulty/DifficultySlider").gameObject;
        playerPrefController = FindObjectOfType <PlayerPrefsController>();

        //populate with saved player prefs
        float volumePref = playerPrefController.GetMasterVolume();

        if (volumeOption.GetComponent <Slider>().value != volumePref)
        {
            volumeOption.GetComponent <Slider>().value = volumePref;
        }
        float difficultyPref = playerPrefController.GetMasterDifficulty();

        if (difficultyOption.GetComponent <Slider>().value != difficultyPref)
        {
            difficultyOption.GetComponent <Slider>().value = difficultyPref;
        }
    }
예제 #9
0
    public void GameDifficulty()
    {
        var gameDifficulty = PlayerPrefsController.GetMasterDifficulty();

        Debug.Log("Difficulty set to" + gameDifficulty);

        //Easy Mode
        if (gameDifficulty == 0f)
        {
            damages = 25;
        }
        //Normal Mode
        else if (gameDifficulty == 1f)
        {
            damages = 35;
        }
        //Hard Mode
        else if (gameDifficulty == 2f)
        {
            damages = 50;
        }
    }
예제 #10
0
    // Start is called before the first frame update
    void Start()
    {
        bool attacker = GetComponent <Attacker>();
        bool defender = GetComponent <Defender>();

        difficulty = PlayerPrefsController.GetMasterDifficulty();

        if (attacker)
        {
            Debug.Log(gameObject.name + " orig health set to: " + fullHealth);
            fullHealth = fullHealth * difficulty;
            Debug.Log(gameObject.name + " diff health set to: " + fullHealth);
        }
        else if (defender)
        {
            Debug.Log(gameObject.name + " orig health set to: " + fullHealth);
            fullHealth = fullHealth / difficulty;
            Debug.Log(gameObject.name + " diff health set to: " + fullHealth);
        }

        currentHealth = fullHealth;
        Debug.Log(gameObject.name + " level health set to: " + currentHealth);
    }
예제 #11
0
    //difficulty

    public void GameDifficulty()
    {
        var gameDifficulty = PlayerPrefsController.GetMasterDifficulty();

        Debug.Log("Difficulty set to " + gameDifficulty);
        //easy
        if (gameDifficulty == 0f)
        {
            return;
        }
        //normal
        else if (gameDifficulty == 1f)
        {
            health      = 100f;
            HpText.text = health.ToString();
        }
        //hard
        else if (gameDifficulty == 2f)
        {
            health      = 50f;
            HpText.text = health.ToString();
        }
    }
예제 #12
0
 public void AddCoins(int amount)
 {
     coins += Mathf.CeilToInt(amount / PlayerPrefsController.GetMasterDifficulty());
     UpdateDisplay();
 }
 private void Start()
 {
     playerHealth = baseHealth - PlayerPrefsController.GetMasterDifficulty();
     healthText   = GetComponent <Text>();
     UpdateHealthDisplay();
 }
예제 #14
0
 // Start is called before the first frame update
 void Start()
 {
     currentHealth = Mathf.Round(maxHealth / PlayerPrefsController.GetMasterDifficulty());
     displayHealth();
 }
예제 #15
0
 // Start is called before the first frame update
 void Start()
 {
     hearts    -= PlayerPrefsController.GetMasterDifficulty();
     heartsText = GetComponent <Text>();
     UpdateHeartsToDisplay();
 }
예제 #16
0
 private void Start()
 {
     SetLevelTimer(PlayerPrefsController.GetMasterDifficulty());
     StartCoroutine(StartSpawners());
 }
예제 #17
0
 private void Start()
 {
     Destroy(gameObject, destroyTime);
     projectileDamage /= PlayerPrefsController.GetMasterDifficulty();
 }
 // Start is called before the first frame update
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetMasterDifficulty();
     musicPlayer            = FindObjectOfType <MusicPlayer>();
 }
예제 #19
0
 private void Start()
 {
     levelTime = baseTime + PlayerPrefsController.GetMasterDifficulty() * timeIncFactror;
 }
예제 #20
0
    private void SetForDifficulty()
    {
        int difficultyFactor = Mathf.RoundToInt(PlayerPrefsController.GetMasterDifficulty() * 200);

        stars -= difficultyFactor;
    }
예제 #21
0
 void Start()
 {
     coins    = Mathf.Round(coins / PlayerPrefsController.GetMasterDifficulty());
     coinText = GetComponent <Text>();
     UpdateDisplay();
 }
예제 #22
0
 private void Start()
 {
     lives     = baseLives - PlayerPrefsController.GetMasterDifficulty();
     livesText = GetComponent <Text>();
     UpdateDisplay();
 }
예제 #23
0
 void Start()
 {
     life     = Mathf.RoundToInt(life / PlayerPrefsController.GetMasterDifficulty());
     lifeText = GetComponent <Text>();
     UpdateDisplay();
 }
예제 #24
0
 void Start()
 {
     score     = Mathf.Round(score / PlayerPrefsController.GetMasterDifficulty());
     scoreText = FindObjectOfType <ScoreBoard>().GetComponent <Text>();
     UpdateScore();
 }