コード例 #1
0
    //private void OnMouseUp()
    //{
    //    setData.BuildingData(building_code.text);
    //}

    public void OnMouseEnterPointer()
    {
        setData.BuildingData(building_code.text);
        gameObject.GetComponent <Image>().sprite = Resources.Load <Sprite>("buildings_icon/" + building_code.text + "_v1");
        foreach (var model in GetDataBuildings.dataBuildings)
        {
            if (model.code.Equals(building_code.text) && reBuilding.ReiterativeBuildingCheck(model))
            {
                buildButton = GameObject.Find("BuildB").GetComponent <IsBuildButton>();
                buildButton.SetButtonSprite("_build_normal");
            }
        }
    }
コード例 #2
0
 //Общая информация о конкретном здании
 public void BuildingData(string building_code)
 {
     foreach (var model in GetDataBuildings.dataBuildings)
     {
         if (model.code.Equals(building_code))
         {
             menus.Open(InfoPanel);
             menus.Close(alertText);
             checkBuildNumberAccess = 0;
             SetText(model.name, buildingNameT);
             SetText(model.description, buildingDescriptionT);
             SetText(model.costgold, buildingGoldT, "gold");
             SetText(model.costwood, buildingWoodT, "wood");
             SetText(model.costrock, buildingRockT, "rock");
             SetText(model.costlimestone, buildingLimestoneT, "limestone");
             SetText(model.costwheat, buildingWheatT, "wheat");
             SetRewardImage(model.code);
             SetText("+" + model.startbuff.ToString(), buildingRewardT);
             if (reBuilding.ReiterativeBuildingCheck(model))
             {
                 Attention(true);
             }
             else
             {
                 Attention(false);
             }
             if (checkBuildNumberAccess == 5)
             {
                 TownData.IsBuild = true;
             }
             else
             {
                 TownData.IsBuild = false;
             }
             TownData.BuildingCode = model.code.ToString();
             TownData.BuildingID   = model.id.ToString();
             break;
         }
     }
 }