// Use this for initialization void Start() { volumeSlider.value = PlayerSettings.GetMasterVolume(); musicPlayer = FindObjectOfType <MusicPlayer>(); difficultySlider.value = PlayerSettings.GetDifficulty(); }
// Use this for initialization void Start() { defenderParent = GameObject.Find(DEFENDER_PARENT_NAME); if (!defenderParent) { defenderParent = new GameObject(DEFENDER_PARENT_NAME); } difficulty = PlayerSettings.GetDifficulty(); }
private void LabelButtonWithCost() { Text costText = GetComponentInChildren <Text>(); if (!costText) { Debug.LogError(name + "Has not cost text!"); return; } int cost = defenderPrefab.StarCost; if (PlayerSettings.GetDifficulty() == 0) { cost /= 2; } else if (PlayerSettings.GetDifficulty() == 2) { cost *= 2; } costText.text = cost.ToString(); }
// Use this for initialization void Start() { livesText = GetComponent <Text>(); numOfLives = baseLifes - PlayerSettings.GetDifficulty(); UpdateDisplay(); }