//IEnumerator RestartTank() //{ // yield return new WaitForSeconds(3f); // SpawnerService.Instance.SpawnTanks(0); //} public void SpawnTankPrefab(Transform spawner, int tankSerial) { TankModel model = new TankModel(tankList.tankScriptableObject[0]); TankController tank = new TankController(model, tankView, spawner); tanks.Add(tank); //return tank; }
public void DestroyTank(TankController controller) { //StartCoroutine(RestartTank()); for (int i = 0; i < tanks.Count; i++) { if (controller == tanks[i]) { controller.Destroy(); SetPlayerDeathCounter(controller); } } StartCoroutine(DestroySsceneObjects()); }
public void InitialiseController(TankController tankController) { controller = tankController; }
private void SetPlayerDeathCounter(TankController controller) { playerDeathCounter++; EventService.Instance.OnPlayerDeath(playerDeathCounter); }