Ejemplo n.º 1
0
    public void SetUp(GameObject ground, ScenarioData scenInfo, IntPoint2D loc)
    {
//		scenario = ground.GetComponent("ScenarioMgr") as ScenarioMgr;
        walkerPool   = ground.GetComponent("WalkerPool") as WalkerPool;
        popMgr       = ground.GetComponent("PopulationManager") as PopulationManager;
        scenarioInfo = scenInfo;
        buildingTile = loc;
        numWorkers   = 0;
        StartCoroutine("GetWorkers");
        StartCoroutine("Distribute");
    }
Ejemplo n.º 2
0
    public void GetGoods(IntPoint2D startingTile, Stack <IntPoint2D> path, StoreManager storeMgr, ScenarioData scenarioInfo)
    {
        GameObject level = GameObject.FindWithTag("GameController");

        WalkerPool pool = level.GetComponent("WalkerPool") as WalkerPool;

        GameObject citizen = pool.GetCitizen(startingTile, ScenarioMgr.Direction.Up);

        CitizenManager citMgr = citizen.GetComponent("CitizenManager") as CitizenManager;

        citMgr.SetUp(scenarioInfo, startingTile, ScenarioMgr.Direction.Up, path, storeMgr, this);
    }
Ejemplo n.º 3
0
    void Awake()
    {
        _spawnAudioSource = GetComponent <AudioSource>();

        _spawnInterval           = TotalSpawnTime / SpawnAmount;
        _walkerContainerRef      = new GameObject();
        _walkerContainerRef.name = "WalkerContainer";
        _beaconRotator           = GetComponentInChildren <Random3DRotation>();

        _burstTimer = 0f;
        _burstsDone = 0;

        _walkerPool = GetComponent <WalkerPool>();
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("in PopulationManager start");
        homeless  = population;
        workforce = (int)(population * workforcePercentage);
        employed  = 0;
        unfilledWorkerRequests = 0;
        startTile          = new IntPoint2D(citizenEntryX, citizenEntryY);
        houseCollection    = new Dictionary <IntPoint2D, HouseManager> ();
        homelessCollection = new Queue <CitizenManager> ();
        walkerPool         = gameObject.GetComponent("WalkerPool") as WalkerPool;
        ScenarioMgr scenMgr = gameObject.GetComponent("ScenarioMgr") as ScenarioMgr;

        scenario = scenMgr.GetInfo();
        StartCoroutine("InitPopulation");
    }