예제 #1
0
        public TileMapMeshGenerator([NotNull] TileMap tileMap, [NotNull] MeshFilter meshFilter,
            [NotNull] SpriteSheet spriteSheet)
        {
            if (tileMap == null) throw new ArgumentNullException("tileMap");
            if (meshFilter == null) throw new ArgumentNullException("meshFilter");
            if (spriteSheet == null) throw new ArgumentNullException("spriteSheet");

            _tileMap = tileMap;
            _meshFilter = meshFilter;
            _spriteSheet = spriteSheet;
        }
예제 #2
0
        private void TryInsertCell(TileMap tileMap, Vector3 cellPoint)
        {
            int col = (int)cellPoint.x;
            int row = (int)cellPoint.y + 1;

            if (col < 0) return;
            if (col > tileMap.Width - 1) return;
            if (row < 0) return;
            if (row > tileMap.Height - 1) return;

            tileMap.SetCell(col, row, _selectedStampCell);
            tileMap.GenerateMesh();
        }
예제 #3
0
        private void TryCloneCellType(TileMap tilemap, Vector3 cellPoint)
        {
            int col = (int)cellPoint.x;
            int row = (int)cellPoint.y + 1;

            if (col < 0) return;
            if (col > tilemap.Width - 1) return;
            if (row < 0) return;
            if (row > tilemap.Height - 1) return;

            _selectedStampCell = tilemap.GetCell(col, row);
        }