public void StartGame(System.Type tankType) { Sound.MusicManager.Play(Sound.MusicType.Game); //level level = FindObjectOfType <View.LevelView>(); //init player tank controllableTank = Factory.TankFactory.Instance.GetItem <Tank>(tankType); var playerSpawnPoint = level.PlayerSpawnPoints.Random(); controllableTank.transform.position = playerSpawnPoint.position; controllableTank.transform.eulerAngles = playerSpawnPoint.eulerAngles; controllableTank.Init(); controllableTank.onDeath += (killing) => EndGame(false); CameraFollower.Instance.SetTarget(controllableTank.transform); CameraFollower.Instance.Center(); session = new Model.Session(); //init enemies EnemySpawner.Instance.SetData( level.EnemySpawnPoints, (enemy) => { enemy.SetData(controllableTank != null ? controllableTank.transform : null); enemy.onDeath += (killing) => { if (killing) { session.score += enemy.KillBonus; session.kills++; } }; }); EnemySpawner.Instance.Spawning = true; game = true; }