add: on clear/fail level functionality

This commit is contained in:
KOSMOGOR
2025-04-27 17:15:31 +03:00
parent d68058fbee
commit 15ea51e465
3 changed files with 49 additions and 4 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ public class LevelController : MonoBehaviour
Vector2 circle = Random.insideUnitCircle * spawnPointInfo.radius;
Vector3 spawnVector = spawnPointInfo.transform.position + new Vector3(circle.x, 0, circle.y);
Enemy spawnedEnemy = Instantiate(enemy, spawnVector, spawnPointInfo.transform.rotation).GetComponent<Enemy>();
spawnedEnemy.prefab = enemy;
aliveEnemies.Add(spawnedEnemy);
}
}
@@ -37,7 +38,7 @@ public class LevelController : MonoBehaviour
}
public void OnPlayerDie() {
GameController.i.OnLevelFailed(SceneManager.GetActiveScene().name, timeSpent);
GameController.i.OnLevelFailed(SceneManager.GetActiveScene().name, timeSpent, aliveEnemies);
GameController.i.LoadDeployScene();
}
}