Ejemplo n.º 1
0
    void FixedUpdate()
    {
        // Every 1 second
        // Get new villager list and check it for status and current resource task
        if (Time.fixedTime >= timeToUpdate)
        {
            if (villagers != null && villagers.Count > 0)
            {
                villagers      = GameObject.Find("VillagerSpawner").GetComponent <SpawnVillagers>().getVillagerList();
                lastListLength = villagers.Count;

                int    index;
                string task, status;
                foreach (GameObject villager in villagers)
                {
                    TownFolkAI script = villager.GetComponent <TownFolkAI>();
                    index = villagers.IndexOf(villager);
                    int tableID = index + 1;
                    task   = script.lastResource;
                    status = script.state;

                    villTasks[index].text    = task;
                    villStatuses[index].text = status;
                }
            }
            // update every 1 second
            timeToUpdate = Time.fixedTime + 1.0f;
        }

        //foreach(GameObject line in villInfoLines)
        //{
        //    // make the object invisible somehow
        //}
    }
Ejemplo n.º 2
0
 public MoveState(TownFolkAI owner)
 {
     this.owner = owner;
 }
Ejemplo n.º 3
0
 public WaitState(TownFolkAI owner)
 {
     this.owner = owner;
 }
Ejemplo n.º 4
0
 public FleeState(TownFolkAI owner)
 {
     this.owner = owner;
 }
Ejemplo n.º 5
0
 public SearchState(TownFolkAI owner)
 {
     this.owner = owner;
 }
Ejemplo n.º 6
0
 public GatherState(TownFolkAI owner)
 {
     this.owner = owner;
 }