public void ApplyResearch() { try { string temp = inputResearch.text.Replace("\u200B", ""); M_InGameResourcesManager.SAddResearch(Int32.Parse(temp) - M_InGameResourcesManager.GetResearchPoints()); } catch (FormatException e) { } }
public void Setup() { if (buildingData != null) { UT_Pair <int, int> cost = M_BuildingManager.SGetBuildingCost(buildingData.id); requiredFood = cost.first; requiredResearch = cost.second; foodText.text = requiredFood.ToString(); researchText.text = requiredResearch.ToString(); if (buildingData != null && requiredFood <= M_InGameResourcesManager.GetFood() && requiredResearch <= M_InGameResourcesManager.GetResearchPoints()) { buildButton.interactable = true; buildButton.image.color = Color.green; } else { buildButton.interactable = false; buildButton.image.color = Color.red; } } }
private void OnEnable() { inputFood.text = M_InGameResourcesManager.GetFood().ToString(); inputResearch.text = M_InGameResourcesManager.GetResearchPoints().ToString(); }
public void Setup(DAT_Building data) { buildingData = data; buildingName.text = data.name; UT_Pair <int, int> cost = M_BuildingManager.SGetBuildingCost(data.id); requiredFood = cost.first; requiredResearch = cost.second; if (data != null && requiredFood <= M_InGameResourcesManager.GetFood() && requiredResearch <= M_InGameResourcesManager.GetResearchPoints()) { buildButton.interactable = true; buildButton.image.color = Color.green; } else { buildButton.interactable = false; buildButton.image.color = Color.red; } }