Exemple #1
0
    internal Obstruction AddObstruction( Obstruction prefab, GridTile tile, float coverValue, Transform model = null )
    {
        Obstruction o = Instantiate( prefab, tile.transform.position, prefab.transform.rotation ) as Obstruction;

        if( o != null ) {
            o.transform.parent = worldContainer.obstructionsHolder;
            o.height = coverValue;
            o.currentTile = tile;
            tile.SetObstruction( o );
            if( model ) {
                o.decor = AddDecor( model, tile );
            }
            return o;
        }

        return null;
    }