コード例 #1
0
    public void BuildCostsList()
    {
        foreach (ResourcesManager.ResourceAmount resourceAmount in buildingType.resourceCosts)
        {
            GameObject instantiatedResourceCostPanel = Instantiate(resourceCostPanelPrefab, new Vector3(0f, 0f, 0f) /*buildingCostsPanel.transform.position*/, Quaternion.identity);
            instantiatedResourceCostPanel.transform.SetParent(buildingCostsPanel.transform, false);

            ResourceCostPanel rcPanel = instantiatedResourceCostPanel.GetComponent <ResourceCostPanel>();
            rcPanel.SetInfo(resourceAmount);
            rcPanel.BuildPanel();

            //Debug.Log("BuildCostsList | Building: " + buildingType.name + " | Resource: " + resourceAmount.resourceType.resourceName + " | Adding to list");
            buildingCostPanelList.Add(instantiatedResourceCostPanel);

            //Debug.Log("Nb CostPanels: " + buildingCostPanelList.Count);
        }
    }
コード例 #2
0
        public void SetResourceCostPosition(Vector3 pPos)
        {
            ResourceCostPanel resourceCostPanel = resourceCostPanelObject.GetComponent <ResourceCostPanel>();

            resourceCostPanel.SetPosition(pPos);
        }
コード例 #3
0
        public void HideResourceCostPanel()
        {
            ResourceCostPanel resourceCostPanel = resourceCostPanelObject.GetComponent <ResourceCostPanel>();

            resourceCostPanel.Hide();
        }
コード例 #4
0
        public void ShowResourceCostPanel(string pBuildingName, int pWoodCost, int pStoneCost)
        {
            ResourceCostPanel resourceCostPanel = resourceCostPanelObject.GetComponent <ResourceCostPanel>();

            resourceCostPanel.Show(pBuildingName, pWoodCost, pStoneCost);
        }