private void Save() { PlayerPrefsController.SetMasterMusic(musicToggle.isOn); PlayerPrefsController.SetMasterEffects(effectToggle.isOn); PlayerPrefsController.SetDiff(difficultySlider.value); }
// Use this for initialization void Start() { volumeSlider.value = PlayerPrefsController.GetMasterVolume(); difficultySlider.value = PlayerPrefsController.GetDifficulty(); }
void TargetIncreasePlayerTakedownCount(NetworkConnection networkConnection) { var ppc = new PlayerPrefsController(); ppc.killCount += 1; }
//--------------------------------------------CURRENCY------------------------------------------------------------- public void UpdateCurrency() //Updates total amount of currency owned { totalCurrencyText.text = "$" + PlayerPrefsController.GetTotalCurrency(); }
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(); } } } }
public void SetDifficulty() { PlayerPrefsController.SetDifficulty((int)difficultySlider.value); }
private void UpdateSecondChanceCost() //Updates cost of buying a second chance { secondChanceCostText.text = "$" + PlayerPrefsController.GetSecondChanceCost(); }
public void StateVolumeSound() { volumeSlider.value = PlayerPrefsController.GetVolume(); }
// Add this game's distance to cumulative video ad checking distance private void AddToDistance() { PlayerPrefsController.SetDistanceSinceAd(distance + PlayerPrefsController.GetDistanceSinceAd()); }
private void Start() { difficulty = PlayerPrefsController.GetDifficulty(); UpdateDifficulty(); }
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); }
// Start is called before the first frame update void Start() { currentHealth = Mathf.Round(maxHealth / PlayerPrefsController.GetMasterDifficulty()); displayHealth(); }
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(); }
public void SaveAndExit() { PlayerPrefsController.SetMasterVolume(volumeSlider.value); PlayerPrefsController.SetDifficulty(difficultySlider.value); levelLoader.LoadMainMenu(); }
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(); }
private void UpdateLongerPaddleCost() //Updates cost of buying a longer paddle { longerPaddleCostText.text = "$" + PlayerPrefsController.GetLongerPaddleCost(); }
private void Start() { audioSource = GetComponent <AudioSource>(); audioSource.volume = PlayerPrefsController.GetMasterVolume(); }
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(); }
void Start() { health -= PlayerPrefsController.GetDifficulty(); healthText = GetComponent <Text>(); UpdateDisplay(); }
private void Start() { _difficulty.value = PlayerPrefsController.GetDifficulty(); _volume.value = PlayerPrefsController.GetMasterVolume(); }
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; } } } }
private void Start() { Destroy(gameObject, destroyTime); projectileDamage /= PlayerPrefsController.GetMasterDifficulty(); }
public void SaveAndExit() { PlayerPrefsController.SetMasterVolume(volumeSlider.value); PlayerPrefsController.SetDifficulty(difficultySlider.value); FindObjectOfType <LevelLoader>().LoadMainMenu(); }
// 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(); }
void Start() { DontDestroyOnLoad(this); audioSource = GetComponent <AudioSource>(); audioSource.volume = PlayerPrefsController.GetMasterVolume(); }
public void GetInstances() { musicToggle.isOn = PlayerPrefsController.GetMasterMusicBool(); effectToggle.isOn = PlayerPrefsController.GetMasterEffectBool(); difficultySlider.value = PlayerPrefsController.GetDifficulty(); }