Beispiel #1
0
    private void Start()
    {
        if (inputFood == null ||
            inputResearch == null)
        {
            Debug.LogWarning("Component hasn't been fully initialized!");
        }



        List <GameObject> rows = new List <GameObject>();

        int i = 0;
        List <DAT_Building> buildings = M_BuildingManager.SGetBuildingsTemplates().GetBuildings();

        foreach (DAT_Building building in buildings)
        {
            GameObject temp = Instantiate(elemBuilding);
            //temp.GetComponent<UI_DevElemBuilding>().Setup(building);


            if (i % 2 == 0)
            {
                temp.GetComponent <Image>().color = elemBgColorA;
            }
            else
            {
                temp.GetComponent <Image>().color = elemBgColorB;
            }
            rows.Add(temp);
            i++;
        }

        GUIUtils.AddElementsToCleanYScrollContainer(container, rows);
    }