Nez.Portable/PipelineRuntime/Tiled/TiledMap.cs
/// <summary>
/// converts from world to tile position clamping to the tilemap bounds
/// </summary>
/// <returns>The to tile position y.</returns>
/// <param name="y">The y coordinate.</param>
converts from world to tile position clamping to the tilemap bounds
converts from world to tile position clamping to the tilemap bounds
public int worldToTilePositionY(float y, bool clampToTilemapBounds = true)
        {
            var tileY = Mathf.fastFloorToInt(y / tileHeight);
            if (!clampToTilemapBounds)
                return tileY;
            return Mathf.clamp(tileY, 0, height - 1);
        }
public int worldToTilePositionY ( float y , bool clampToTilemapBounds = true ) { var tileY = Mathf . fastFloorToInt ( y / tileHeight ) ; if ( ! clampToTilemapBounds ) return tileY ; return Mathf . clamp ( tileY , 0 , height - 1 ) ; }
converts from world to tile position clamping to the tilemap bounds
converts from world to tile position clamping to the tilemap bounds
The to tile position y.
The to tile position y .
y
float
The y coordinate.
The y coordinate .
clampToTilemapBounds
bool