Esempio n. 1
0
 public void ApplyResearch()
 {
     try
     {
         string temp = inputResearch.text.Replace("\u200B", "");
         M_InGameResourcesManager.SAddResearch(Int32.Parse(temp) - M_InGameResourcesManager.GetResearchPoints());
     } catch (FormatException e) { }
 }
Esempio n. 2
0
    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;
            }
        }
    }
Esempio n. 3
0
 private void OnEnable()
 {
     inputFood.text     = M_InGameResourcesManager.GetFood().ToString();
     inputResearch.text = M_InGameResourcesManager.GetResearchPoints().ToString();
 }
Esempio n. 4
0
    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;
        }
    }