コード例 #1
0
    void onStateChanged(BuildingState newstate)
    {
        var st = currentState;

        Close();
        BuildingInfoUI.ShowUI(st.Building);
    }
コード例 #2
0
 void showBuildingInfo()
 {
     if (GameUtility.GetTileUnderMousePosition(out Tile tile))
     {
         if (tile is TileWithBuilding tileWithBuilding)
         {
             if (tileWithBuilding.Building is StorageBuilding)
             {
                 StorageBuilding storageBuilding = (StorageBuilding)tileWithBuilding.Building;
                 StorageInfo.ShowRecources(storageBuilding.Storage);
             }
             else if (tileWithBuilding.Building is BuildingNearRoad buildingNearRoad)
             {
                 BuildingInfoUI.ShowUI(buildingNearRoad);
             }
         }
         else
         {
             //Debug.Log("Тайл " + tile.TileID + " без строения");
         }
     }
 }