Ejemplo n.º 1
0
    public override void OnPlace(Tile[] parentTiles)
    {
        base.OnPlace(parentTiles);

        unitsController = GameObject.Find("UnitsController").GetComponent <UnitsController>();

        UpdateBuildingModel();
        populationController = GameObject.Find("PopulationController").GetComponent(typeof(PopulationController)) as PopulationController;
        populationController.ChangeTotalNumberOfJobs(tileProperties.buildingProperties.workersRequired);

        UpdateRoadAccess();
        CheckForWorkers();

        if ((hasRoadAccess || !tileProperties.buildingProperties.requiresRoadAccess) && foundWorkers)
        {
            ChangeRunningValue(true);
        }
        else
        {
            StartCoroutine("WaitForRoadAccessAndWorkers");
        }
    }
Ejemplo n.º 2
0
 void OnDestroy()
 {
     populationController.ChangeTotalNumberOfJobs(tileProperties.buildingProperties.workersRequired * -1);
 }