*
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
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<UnityEngine.image
|
||||
try {
|
||||
fadeImage.SetActive(true);
|
||||
fadeImage.GetComponent<Animator>().SetTrigger("Fade");
|
||||
}
|
||||
catch {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void NewGameLoad(){
|
||||
Debug.Log("Load level");
|
||||
Application.LoadLevel("Level0");
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
Time.timeScale = 1;
|
||||
_source = GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user