Example #1
0
 public static void Restart()
 {
     foreach (Tile t in ground)
     {
         Destroy(t.gameObject);
     }
     foreach (Tile w in wall)
     {
         if (w != null)
         {
             Destroy(w.gameObject);
         }
     }
     tiles = null;
     Destroy(player.gameObject);
     Destroy(monsta.gameObject);
     if (stash != null)
     {
         Destroy(stash.gameObject);
     }
     Destroy(exit);
     exit     = null;
     player   = null;
     monsta   = null;
     stash    = null;
     gotStash = false;
     mazeHelper.Generate();
 }
Example #2
0
 private void Start()
 {
     LoadSounds();
     mazeHelper = GetComponent <MazeGeneratorHelper>();
     mazeHelper.onMazeGenerated = () => {
         this.maze = GetComponent <MazeGeneratorHelper>().texture;
         Init();
     };
     mazeHelper.Generate();
 }