Ejemplo n.º 1
0
        /// <summary>
        /// Expand autotile atlas.
        /// </summary>
        /// <param name="borderSize">Border size in pixels.</param>
        private void ExpandAutotileArtwork(int borderSize = 0)
        {
            this.ClearExpandedAutotileAtlas();

            this.ApplyAutotileConstraintsToInputs();

            if (this.inputNewAutotileArtworkUncompressed != null)
            {
                this.expandedAutotileAtlas = AutotileExpanderUtility.ExpandAutotileArtwork(this.autotileTileset.AutotileLayout, this.inputNewAutotileArtworkUncompressed, this.inputTileWidth, this.inputTileHeight, this.autotileTileset.HasInnerJoins, borderSize, this.inputClampEdges);
            }

            int atlasWidth  = 0;
            int atlasHeight = 0;

            if (this.expandedAutotileAtlas != null)
            {
                atlasWidth  = this.expandedAutotileAtlas.width;
                atlasHeight = this.expandedAutotileAtlas.height;
            }

            this.inputTilesetMetrics.Calculate(atlasWidth, atlasHeight, this.inputTileWidth, this.inputTileHeight, borderSize, this.inputDelta);
        }
Ejemplo n.º 2
0
        private void ExpandAutotileArtwork(int borderSize = 0)
        {
            this.ClearExpandedAutotileArtwork();

            AutotileExpanderUtility.ApplyTileSizeConstraints(s_SelectedAutotileLayout, this.autotileTextureUncompressed, s_InnerJoins, ref this.tileWidth, ref this.tileHeight, ref s_BorderSize);

            if (this.autotileTextureUncompressed != null)
            {
                this.atlasTexture           = AutotileExpanderUtility.ExpandAutotileArtwork(s_SelectedAutotileLayout, this.autotileTextureUncompressed, this.tileWidth, this.tileHeight, s_InnerJoins, borderSize, s_EnableClampEdges);
                this.atlasTexture.hideFlags = HideFlags.HideAndDontSave;
            }

            int atlasWidth = 0, atlasHeight = 0;

            if (this.atlasTexture != null)
            {
                atlasWidth  = this.atlasTexture.width;
                atlasHeight = this.atlasTexture.height;
            }

            this.metrics.Calculate(atlasWidth, atlasHeight, this.tileWidth, this.tileHeight, borderSize, s_Delta);
        }