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); } }
public void SetResourceCostPosition(Vector3 pPos) { ResourceCostPanel resourceCostPanel = resourceCostPanelObject.GetComponent <ResourceCostPanel>(); resourceCostPanel.SetPosition(pPos); }
public void HideResourceCostPanel() { ResourceCostPanel resourceCostPanel = resourceCostPanelObject.GetComponent <ResourceCostPanel>(); resourceCostPanel.Hide(); }
public void ShowResourceCostPanel(string pBuildingName, int pWoodCost, int pStoneCost) { ResourceCostPanel resourceCostPanel = resourceCostPanelObject.GetComponent <ResourceCostPanel>(); resourceCostPanel.Show(pBuildingName, pWoodCost, pStoneCost); }