Пример #1
0
 private void Save()
 {
     PlayerPrefsController.SetMasterMusic(musicToggle.isOn);
     PlayerPrefsController.SetMasterEffects(effectToggle.isOn);
     PlayerPrefsController.SetDiff(difficultySlider.value);
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetDifficulty();
 }
Пример #3
0
    void TargetIncreasePlayerTakedownCount(NetworkConnection networkConnection)
    {
        var ppc = new PlayerPrefsController();

        ppc.killCount += 1;
    }
Пример #4
0
 //--------------------------------------------CURRENCY-------------------------------------------------------------
 public void UpdateCurrency() //Updates total amount of currency owned
 {
     totalCurrencyText.text = "$" + PlayerPrefsController.GetTotalCurrency();
 }
Пример #5
0
    private void HoldFire()
    {
        if (currentMag > 0)
        {
            if (Input.GetMouseButton(0))
            {
                animator.SetBool("isHolding", true);
                Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                shootingDirection = (mousePos - (Vector2)transform.position) / (mousePos - (Vector2)transform.position).magnitude;

                currentDamageMultiplier += Time.deltaTime;
                if (currentDamageMultiplier >= fireRate)
                {
                    currentDamageMultiplier = fireRate;
                }
            }
            else if (Input.GetMouseButtonUp(0))
            {
                if (fireable)
                {
                    animator.SetBool("isHolding", false);
                    FireRate(currentDamageMultiplier);
                    AudioSource.PlayClipAtPoint(bowSound, Camera.main.transform.position, PlayerPrefsController.GetSoundVolume());
                    ResetFireRate();
                }
            }
        }
        else
        {
            animator.SetBool("isHolding", false);
            fireable = false;
            if (magLeft <= 0)
            {
                if (Input.GetMouseButtonDown(0))
                {
                    AudioSource.PlayClipAtPoint(noAmmo, Camera.main.transform.position, PlayerPrefsController.GetSoundVolume());
                }
            }
            else
            {
                reloadTime -= Time.deltaTime;
                if (reloadTime <= 0)
                {
                    FireReload();
                }
            }
        }
    }
Пример #6
0
 public void SetDifficulty()
 {
     PlayerPrefsController.SetDifficulty((int)difficultySlider.value);
 }
Пример #7
0
 private void UpdateSecondChanceCost() //Updates cost of buying a second chance
 {
     secondChanceCostText.text = "$" + PlayerPrefsController.GetSecondChanceCost();
 }
Пример #8
0
 public void StateVolumeSound()
 {
     volumeSlider.value = PlayerPrefsController.GetVolume();
 }
Пример #9
0
 // Add this game's distance to cumulative video ad checking distance
 private void AddToDistance()
 {
     PlayerPrefsController.SetDistanceSinceAd(distance + PlayerPrefsController.GetDistanceSinceAd());
 }
Пример #10
0
    private void Start()
    {
        difficulty = PlayerPrefsController.GetDifficulty();

        UpdateDifficulty();
    }
Пример #11
0
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     musicPlayer            = FindObjectOfType <MusicPlayer>();
     difficultySlider.value = PlayerPrefsController.GetDifficulty();
 }
 public void SaveOptions()
 {
     PlayerPrefsController.SetMasterVolume(volumeSlider.value);
     PlayerPrefsController.SetDifficulty((int)difficultySlider.value);
 }
Пример #13
0
 // Start is called before the first frame update
 void Start()
 {
     currentHealth = Mathf.Round(maxHealth / PlayerPrefsController.GetMasterDifficulty());
     displayHealth();
 }
Пример #14
0
 private void ApplyDifficulty()
 {
     lives = Mathf.Round(baseLives / PlayerPrefsController.GetDifficulty());
     lives = lives < 1 ? 1 : lives;
 }
 private void Start()
 {
     lives     = baseLives - PlayerPrefsController.GetDifficulty();
     livesText = GetComponent <TextMeshProUGUI>();
     UpdateDisplay();
 }
Пример #16
0
 public void SaveAndExit()
 {
     PlayerPrefsController.SetMasterVolume(volumeSlider.value);
     PlayerPrefsController.SetDifficulty(difficultySlider.value);
     levelLoader.LoadMainMenu();
 }
Пример #17
0
 public void SetVolume()
 {
     PlayerPrefsController.SetMasterVolume(volumeSlider.value);
 }
 // Start is called before the first frame update
 void Start()
 {
     playerHP     = baseHP - PlayerPrefsController.GetDifficulty();
     playerHPText = GetComponent <Text>();
     UpdateDisplay();
 }
Пример #19
0
 private void UpdateLongerPaddleCost() //Updates cost of buying a longer paddle
 {
     longerPaddleCostText.text = "$" + PlayerPrefsController.GetLongerPaddleCost();
 }
 private void Start()
 {
     audioSource        = GetComponent <AudioSource>();
     audioSource.volume = PlayerPrefsController.GetMasterVolume();
 }
Пример #21
0
 private void NewExplosiveBallPrice() //Change price based on how many times bought
 {
     PlayerPrefsController.SetExplosiveBallCost(explosiveBallCost + 1);
     explosiveBallButton.GetComponent <Button>().interactable = false;
     explosiveBallCostText.text = "OUT OF STOCK";
 }
    public void SaveAndExit()
    {
        PlayerPrefsController.Save();

        FindObjectOfType <LevelLoader>().LoadStartScene();
    }
Пример #23
0
 void Start()
 {
     health    -= PlayerPrefsController.GetDifficulty();
     healthText = GetComponent <Text>();
     UpdateDisplay();
 }
 private void Start()
 {
     _difficulty.value = PlayerPrefsController.GetDifficulty();
     _volume.value     = PlayerPrefsController.GetMasterVolume();
 }
Пример #25
0
 private void RapidFire()
 {
     if (currentMag > 0)
     {
         Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         shootingDirection = (mousePos - (Vector2)transform.position) / (mousePos - (Vector2)transform.position).magnitude;
         if (Input.GetMouseButton(0))
         {
             fireRate -= Time.deltaTime;
             if (fireRate <= 0)
             {
                 FireRate(currentDamageMultiplier);
                 AudioSource.PlayClipAtPoint(bowSound, Camera.main.transform.position, PlayerPrefsController.GetSoundVolume());
                 ResetFireRate();
             }
         }
     }
     else
     {
         hand.enabled = false;
         if (magLeft <= 0)
         {
             if (Input.GetMouseButtonDown(0))
             {
                 AudioSource.PlayClipAtPoint(noAmmo, Camera.main.transform.position, PlayerPrefsController.GetSoundVolume());
             }
         }
         else
         {
             reloadTime -= Time.deltaTime;
             if (reloadTime <= 0)
             {
                 FireReload();
                 hand.enabled = true;
             }
         }
     }
 }
Пример #26
0
 private void Start()
 {
     Destroy(gameObject, destroyTime);
     projectileDamage /= PlayerPrefsController.GetMasterDifficulty();
 }
Пример #27
0
 public void SaveAndExit()
 {
     PlayerPrefsController.SetMasterVolume(volumeSlider.value);
     PlayerPrefsController.SetDifficulty(difficultySlider.value);
     FindObjectOfType <LevelLoader>().LoadMainMenu();
 }
Пример #28
0
 // Start is called before the first frame update
 void Start()
 {
     DontDestroyOnLoad(this); //don't destroy target when loading new scene
     audioSource        = GetComponent <AudioSource>();
     audioSource.volume = PlayerPrefsController.GetMasterVolume();
 }
Пример #29
0
 void Start()
 {
     DontDestroyOnLoad(this);
     audioSource        = GetComponent <AudioSource>();
     audioSource.volume = PlayerPrefsController.GetMasterVolume();
 }
Пример #30
0
 public void GetInstances()
 {
     musicToggle.isOn       = PlayerPrefsController.GetMasterMusicBool();
     effectToggle.isOn      = PlayerPrefsController.GetMasterEffectBool();
     difficultySlider.value = PlayerPrefsController.GetDifficulty();
 }