exTileMapEditor.SnapToGrid C# (CSharp) Method

SnapToGrid() private method

private SnapToGrid ( exTileMap, _tileMap, Vector2 _pos, int &_x, int &_y ) : void
_tileMap exTileMap,
_pos Vector2
_x int
_y int
return void
    void SnapToGrid( exTileMap _tileMap, Vector2 _pos, out int _x, out int _y )
    {
        _x = Mathf.FloorToInt(_pos.x / _tileMap.tileWidth) * _tileMap.tileWidth;
        _y = Mathf.FloorToInt(_pos.y / _tileMap.tileHeight) * _tileMap.tileHeight;
    }