示例#1
0
        private void PlaceTileAsTile(GameObject goTilemap, Tilemap tilemap, TilemapRenderer tilemapRenderer, SuperTile tile, TileIdMath tileId, Vector3Int pos3)
        {
            // Burn our layer index into the z component of the tile position
            // This allows us to support Tilemaps being shared by groups
            pos3.z = RendererSorter.CurrentTileZ;

            if (SuperImportContext.LayerIgnoreMode != LayerIgnoreMode.Visual)
            {
                // Set the tile (sprite, transform matrix, flags)
                tilemap.SetTile(pos3, tile);
                tilemap.SetTransformMatrix(pos3, tile.GetTransformMatrix(tileId.FlipFlags, m_MapComponent.m_Orientation));

#if UNITY_2018_3_OR_NEWER
                if (tilemapRenderer.mode == TilemapRenderer.Mode.Individual)
                {
                    // Each tile color must be set individually
                    tilemap.SetColor(pos3, tilemap.color);
                }
#endif

                tilemap.SetTileFlags(pos3, TileFlags.LockAll);
            }

            if (SuperImportContext.LayerIgnoreMode != LayerIgnoreMode.Collision)
            {
                // Do we have any colliders on the tile to be gathered?
                m_CurrentCollisionBuilder.PlaceTileColliders(m_MapComponent, tile, tileId, pos3);
            }
        }
示例#2
0
        private void PlaceTileAsTile(GameObject goTilemap, SuperTile tile, TileIdMath tileId, Vector3Int pos3)
        {
            var tilemap = goTilemap.GetComponent <Tilemap>();

            tilemap.SetTile(pos3, tile);

            // Do we have any colliders on the tile to be gathered?
            m_CurrentCollisionBuilder.PlaceTileColliders(tile, tileId, pos3);
        }
        private void PlaceTileAsTile(GameObject goTilemap, SuperTile tile, TileIdMath tileId, Vector3Int pos3)
        {
            // Burn our layer index into the z component of the tile position
            // This allows us to support Tilemaps being shared by groups
            pos3.z = RendererSorter.CurrentTileZ;

            // Set the tile (sprite, transform matrix, flags)
            var tilemap = goTilemap.GetComponentInParent <Tilemap>();

            tilemap.SetTile(pos3, tile);
            tilemap.SetTransformMatrix(pos3, tile.GetTransformMatrix(tileId.FlipFlags));
            tilemap.SetTileFlags(pos3, TileFlags.LockAll);

            // Do we have any colliders on the tile to be gathered?
            m_CurrentCollisionBuilder.PlaceTileColliders(m_MapComponent, tile, tileId, pos3);
        }
        private void PlaceTileAsTile(GameObject goTilemap, SuperTile tile, TileIdMath tileId, Vector3Int pos3)
        {
            // Burn our layer index into the z component of the tile position
            // This is needed for when using a custom sort axis
            pos3.z = m_TileLayerCounter;

            // Set the flip data
            var tilemapData = goTilemap.GetComponentInParent <TilemapData>();

            tilemapData.SetFlipFlags(pos3, tileId.FlipFlags);

            // Set the tile
            var tilemap = goTilemap.GetComponentInParent <Tilemap>();

            tilemap.SetTile(pos3, tile);

            // Do we have any colliders on the tile to be gathered?
            m_CurrentCollisionBuilder.PlaceTileColliders(m_MapComponent, tile, tileId, pos3);
        }