private void FillValues()
        {
            nameTxt.text            = selectedBuilding.data.Name;
            pollutionAmountTxt.text = string.Format("{0:0}", BuildingsHandler.ConvertToPollutionPerYear(selectedBuilding.data.Pollution, selectedBuilding.data.Productiontime));

            FillGridValues(inputGrid, selectedBuilding.data.Moneyinput, selectedBuilding.data.Resourceinput, selectedBuilding.data.Resourceinputamount);
            FillGridValues(outputGrid, selectedBuilding.data.Moneyoutput, selectedBuilding.data.Resourceoutput, selectedBuilding.data.Resourceoutputamount);
        }
        private void UpdateInfo(int id, System.Object data)
        {
            if (data.GetType() != typeof(BuildingsData))
            {
                return;
            }

            BuildingsData selectedBuildingData = data as BuildingsData;

            gameObject.SetActive(true);
            costGrid.transform.RemoveChildren();
            productionGrid.transform.RemoveChildren();
            inputGrid.transform.RemoveChildren();

            nameTxt.text            = selectedBuildingData.Name;
            pollutionAmountTxt.text = string.Format("{0:0}", BuildingsHandler.ConvertToPollutionPerYear(selectedBuildingData.Pollution, selectedBuildingData.Productiontime));
            productionTime.text     = selectedBuildingData.Productiontime.ToString() + " seconds";

            climateTxt.gameObject.SetActive(selectedBuildingData.Climate != Climate.None);
            if (selectedBuildingData.Climate != Climate.None)
            {
                climateTxt.text = selectedBuildingData.Climate.ToString();
            }

            if (selectedBuildingData.Climate != Player.LocalPlayer.ClimateType)
            {
                climateTxt.color = incorrectClimateColor;
            }
            else
            {
                climateTxt.color = correctClimateColor;
            }

            // cost:
            Sprite sprite;

            if (selectedBuildingData.Moneycost > 0)
            {
                sprite = DataManager.ResourcePrefabs.MoneySprite;
                Instantiate(productItemPrefab, costGrid.transform).Init(sprite, selectedBuildingData.Moneycost, true);
            }

            for (int i = 0; i < selectedBuildingData.Resourcecost.Length; i++)
            {
                sprite = DataManager.ResourcePrefabs.GetResourceSprite(selectedBuildingData.Resourcecost[i]);
                Instantiate(productItemPrefab, costGrid.transform).Init(sprite, selectedBuildingData.Resourcecostamount[i], selectedBuildingData.Resourcecost[i]);
            }

            // input:
            if (selectedBuildingData.Moneyinput > 0)
            {
                sprite = DataManager.ResourcePrefabs.MoneySprite;
                Instantiate(productItemPrefab, inputGrid.transform).Init(sprite, selectedBuildingData.Moneyinput);
            }

            for (int i = 0; i < selectedBuildingData.Resourceinput.Length; i++)
            {
                sprite = DataManager.ResourcePrefabs.GetResourceSprite(selectedBuildingData.Resourceinput[i]);
                Instantiate(productItemPrefab, inputGrid.transform).Init(sprite, selectedBuildingData.Resourceinputamount[i]);
            }


            // production:
            if (selectedBuildingData.Moneyoutput > 0)
            {
                sprite = DataManager.ResourcePrefabs.MoneySprite;
                Instantiate(productItemPrefab, productionGrid.transform).Init(sprite, selectedBuildingData.Moneyoutput);
            }

            for (int i = 0; i < selectedBuildingData.Resourceoutput.Length; i++)
            {
                sprite = DataManager.ResourcePrefabs.GetResourceSprite(selectedBuildingData.Resourceoutput[i]);
                Instantiate(productItemPrefab, productionGrid.transform).Init(sprite, selectedBuildingData.Resourceoutputamount[i]);
            }
        }