void Start()
    {
        if (_instance != null)
        {
            Debug.LogError("There should not be more than one VillagerManager");
        }

        _instance = this;

        villagers = new Dictionary <Villager, GameObject>();

        //FIXME: testing only


        for (int i = 0; i < 2; i++)
        {
            Villager vil = new Villager(MapController.Instance.Map.GetTileAt(i, 2 * i), "Steve_" + i, 10f);

            vil.Start();
            CreateVillagerObject(vil);

            vil.Inventory.RegisterOnCarryingChangedCallback(
                () => {
                if (vil.Equals(UIControllerBuildMode.Instance.UIActiveVillager))
                {
                    UIControllerBuildMode.Instance.UpdateAllUI(vil);
                }
            });
        }
    }
Ejemplo n.º 2
0
 public void DecreaseRole(int num)
 {
     VillagerManager.DecreaseRole((AI_Character.Role)num);
     UpdateVillagerCount();
 }
Ejemplo n.º 3
0
 public void IncreaseRole(int num)
 {
     VillagerManager.IncreaseRole((AI_Character.Role)(num));
     UpdateVillagerCount();
 }