using UnityEngine; using System.Collections; public class MainMenuController : MonoBehaviour { public AudioClip newGameSound; private AudioSource _source; public GameObject fadeImage; public void OnButtonExit(){ Application.Quit(); } public void OnButtonNewGame(){ Invoke("NewGameLoad", 5); if(_source != null & newGameSound != null){ _source.PlayOneShot(newGameSound); } //fadeImage.GetComponent().SetTrigger("Fade"); } catch { } } private void NewGameLoad(){ Debug.Log("Load level"); Application.LoadLevel("Level0"); } // Use this for initialization void Start () { Time.timeScale = 1; _source = GetComponent(); } // Update is called once per frame void Update () { } }