Ejemplo n.º 1
0
    public void Refresh()
    {
        var human = SessionData.Data.ResourceStorage.People.GetEnumerator();

        for (int i = 0; i < SessionData.Data.ResourceStorage.People.Count; i++)
        {
            human.MoveNext();
            HumanUI NewHumanUI;
            if (i >= HumanUIList.Count)
            {
                NewHumanUI = GameObject.Instantiate(HumanShortInfoPrefub);
                NewHumanUI.transform.SetParent(MainHumanList.transform, false);
                HumanUIList.Add(NewHumanUI);
            }
            else
            {
                NewHumanUI = HumanUIList[i];
            }
            NewHumanUI.SelectHuman(human.Current.Value, true);
            if (IsProfessionChecked(human.Current.Value.Profession) &&
                (FreeFilter.isOn ? human.Current.Value.Activity != Human.ActivityType.Working : true))
            {
                NewHumanUI.Show();
            }
            else
            {
                NewHumanUI.Hide();
            }
        }
        for (int i = SessionData.Data.ResourceStorage.People.Count; i < HumanUIList.Count; i++)
        {
            HumanUIList[i].Hide();
        }
    }
Ejemplo n.º 2
0
    public void Refresh()
    {
        for (int i = 0; i < FreeHumanList.Count; i++)
        {
            HumanUI NewHumanUI;
            if (i >= FreeHumanUIList.Count)
            {
                NewHumanUI = GameObject.Instantiate(HumanShortInfoPrefub);
                NewHumanUI.transform.SetParent(MainHumanContainer.transform, false);
                FreeHumanUIList.Add(NewHumanUI);
            }
            else
            {
                NewHumanUI = FreeHumanUIList[i];
            }
            NewHumanUI.gameObject.SetActive(true);
            NewHumanUI.SelectHuman(FreeHumanList[i], false);
        }
        for (int i = FreeHumanList.Count; i < FreeHumanUIList.Count; i++)
        {
            FreeHumanUIList[i].Hide();
        }

        for (int i = 0; i < HiredHumanList.Count; i++)
        {
            HumanUI NewHumanUI;
            if (i >= HiredHumanUIList.Count)
            {
                NewHumanUI = GameObject.Instantiate(HumanShortInfoPrefub);
                NewHumanUI.transform.SetParent(HiredHumanContainer.transform, false);
                HiredHumanUIList.Add(NewHumanUI);
            }
            else
            {
                NewHumanUI = HiredHumanUIList[i];
            }
            NewHumanUI.gameObject.SetActive(true);
            NewHumanUI.SelectHuman(HiredHumanList[i], false);
        }
        for (int i = HiredHumanList.Count; i < HiredHumanUIList.Count; i++)
        {
            HiredHumanUIList[i].Hide();
        }
    }