Beispiel #1
0
 void Start()
 {
     try
     {
         gameManager = GameObject.FindObjectOfType<GameManager>();
         if (gameManager == null)
             throw new NullReferenceException("Missing the GameManager"); //throw error
         pool = GameObject.FindObjectOfType<PawnPool>();
         if (pool == null)
             throw new NullReferenceException("Missing the PawnPool");
     }
     catch (Exception e)
     {
         ErrorUI.error = e.Message;
         LevelManager.getInstance().LoadLevel("Error");
         Destroy(GameObject.Find("UIManager"));
     }
 }
Beispiel #2
0
 void Start()
 {
     try
     {
         gameManager = GameObject.FindObjectOfType <GameManager>();
         if (gameManager == null)
         {
             throw new NullReferenceException("Missing the GameManager"); //throw error
         }
         pool = GameObject.FindObjectOfType <PawnPool>();
         if (pool == null)
         {
             throw new NullReferenceException("Missing the PawnPool");
         }
     }
     catch (Exception e)
     {
         ErrorUI.error = e.Message;
         LevelManager.getInstance().LoadLevel("Error");
         Destroy(GameObject.Find("UIManager"));
     }
 }