public TankController(TankScriptableObject tankProps) { model = new TankModel(); view = GameObject.Instantiate(tankProps.tankPrefab); view.SetController(this); shellPool = new ShellPool(tankProps.shellPrefab); tankType = tankProps.tankType; shellPrefab = tankProps.shellPrefab; }
public void TakeDamage(float damage) { model.TakeDamage(damage); if (model.Health == 0) { view.DestroyView(); view = null; if (tankType == TankType.PlayerTank) { GameplayService.Instance.GameOver(false); } else { GameplayService.Instance.GameOver(true); } } }