Created
January 30, 2015 18:40
-
-
Save ellisonleao/e584f3406cd80e08962e to your computer and use it in GitHub Desktop.
Intro Scene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Intro : MonoBehaviour { | |
SimpleGameManager GM; | |
void Awake () { | |
GM = SimpleGameManager.Instance; | |
GM.OnStateChange += HandleOnStateChange; | |
Debug.Log("Current game state when Awakes: " + GM.gameState); | |
} | |
void Start () { | |
Debug.Log("Current game state when Starts: " + GM.gameState); | |
GM.SetGameState(GameState.MAIN_MENU); | |
} | |
public void HandleOnStateChange () | |
{ | |
Debug.Log("Handling state change to: " + GM.gameState); | |
Invoke("LoadLevel", 3f); | |
} | |
public void LoadLevel(){ | |
Debug.Log("Invoking LoadLevel"); | |
Application.LoadLevel("Menu"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment