public TankController(TankModel tankModel, TankView tankPrefab, Transform spawner) { TankModel = tankModel; TankView = GameObject.Instantiate <TankView>(tankPrefab, spawner.transform.position, spawner.transform.rotation); TankView.InitialiseController(this); TankView.SetViewDetails(); }
public void SetViewDetails() { model = controller.TankModel; SetTankSpeed(model.MovingSpeed, model.RotatingSpeed); SetTankHealth(model.Health); SetTankDamage(model.BulletDamage); SetTankColor(model.TankColor); }
//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; }