void OnEnable() { isGameOver = true; HUDbuttons.SetActive(false); SaveLoadPrefs.Load(); StartCoroutine(MusicSettings.TurnOffMusic()); StartCoroutine(Display()); }
void Start() { curMenu = CurMenu.Pause; //just to avoid any null references for the static variable, we're going to find the audio source _audio = gameObject.GetComponent <AudioSource>(); AudioSource music = GameObject.Find("AudioManager/Music").GetComponent <AudioSource>(); MusicScript.auSource = music; //setting defaults difficulty = Difficulty.Normal; gameSpeed = GameSpeed.Slow; resolution = Resolution.Fullscreen; scaleTime = 1f; SFXvolume = .8f; //loading all player prefs SaveLoadPrefs.Load(); }
// Use this for initialization void Start() { SaveLoadPrefs.Load(); canSelect = true; au.volume = PauseMenus.SFXvolume; //Time.timeScale = PauseMenus.gameSpeed; myEvent = GameObject.Find("Canvas/EventSystem").GetComponent <UnityEngine.EventSystems.EventSystem>(); //finding all butons within the menu Transform menu = gameObject.transform; foreach (Transform child in menu) { button.Add(child.gameObject); } myEvent.SetSelectedGameObject(button[0]); GameObject.Find("Canvas/Menus/GameTitle").GetComponent <Animator>().Play("Intro", 0, 0); GameObject.Find("Canvas/Menus").GetComponent <Animator>().Play("Introduction", 0, 0); Animator anim = GameObject.Find("Canvas/Background").GetComponent <Animator>(); anim.speed = 1; anim.Play("FromBlack", 0, 0); }