void Update() { if (Enemy == null && PlayerGM.GetComponent <Character>().CanEnemyBeSpawn() && XmlLoader.NextEnemyTime(NextEnemyInt, NextLevelInt, Time.time - LastEnemyDied) <= 0) { Enemy = XmlLoader.CreateEnemy(PlayerGM, NextEnemyInt++, NextLevelInt); if (Enemy == null && PlayerGM.GetComponent <LevelUper>() == null) { EndLevel(); } } if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } }