コード例 #1
0
    public bool PlaceBuilding(iBuildingReceiver tile)
    {
        if (tile == null)
        {
            return(false);
        }

        if (tile.canReceiveBuilding())
        {
            this.transform.position = tile.getPlacementLocation();
            tile.ReceiveBuilding(this as iBuildingPlacer);

            placedRowCol = tile.getRowCol();

            //store the hover interface for the tile so that we can passthru hovers on the building
            tileHover = tile.getGameObject().GetComponent <iHoverable>();

            myReceiverTile = tile;
            return(true);
        }
        else
        {
            return(false);
        }
    }
コード例 #2
0
 public void SpawnTransparentBuilding_onCurrentTile()
 {
     //If there is a currently hovered tile, and build mode has been activated
     //Spawn a transparent building on it
     if (_currentTile_buildMode != null)
     {
         //Only place if the tile can receive a building (doesn't have one already)
         if (_currentTile_buildMode.canReceiveBuilding())
         {
             PlaceTransparentBuilding(_currentTile_buildMode);
         }
     }
 }
コード例 #3
0
ファイル: BuildingUnit.cs プロジェクト: DMastromonaco/ViRa
    public bool PlaceBuilding(iBuildingReceiver tile)
    {
        if(tile == null)
        {
            return false;
        }

        if(tile.canReceiveBuilding())
        {
            this.transform.position = tile.getPlacementLocation();
            tile.ReceiveBuilding(this as iBuildingPlacer);

            placedRowCol = tile.getRowCol();

            //store the hover interface for the tile so that we can passthru hovers on the building
            tileHover = tile.getGameObject().GetComponent<iHoverable>();

            myReceiverTile = tile;
            return true;
        }
        else
        {
            return false;
        }
    }