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