Exemple #1
0
        public Vector2 GetUvCoordsForCell(Cell value)
        {
            var height = _material.mainTexture.height;

            int rows = height / _cellSize;

            return new Vector2(value.Col, rows - (value.Row + 1)) * UnitCoordSize;
        }
        private Vector2[] CreateVerts(Cell cell)
        {
            var size = _tileMap.UnitSize;

            return new []
            {
                new Vector2(cell.Col * size, cell.Row*size),
                new Vector2(cell.Col* size + size, cell.Row*size),
                new Vector2(cell.Col *size + size, cell.Row*size - size),
                new Vector2(cell.Col*size, cell.Row*size - size),
            };
        }
Exemple #3
0
 public int GetIndexFromCell(Cell cell)
 {
     return cell.Col + cell.Row*Columns;
 }