Exemplo n.º 1
0
        static public TextureSpriteSettings ExtractTextureSpriteSettings(this TextureImporterSettings tis)
        {
            var ts = new TextureSpriteSettings();

            ts.pixelsPerUnit = tis.spritePixelsPerUnit;
            ts.meshType      = tis.spriteMeshType;
            ts.extrudeEdges  = tis.spriteExtrude;
            return(ts);
        }
Exemplo n.º 2
0
        public static TextureGenerationOutput GenerateTextureSprite(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                                    TextureSpriteSettings spriteSettings, TextureAlphaSettings alphaSettings = null, TextureMipmapSettings mipmapSettings = null, TextureWrapSettings wrapSettings = null)
        {
            if (alphaSettings == null)
            {
                alphaSettings = new TextureAlphaSettings(TextureImporterAlphaSource.FromInput, 0.5f);
            }
            if (wrapSettings == null)
            {
                wrapSettings = new TextureWrapSettings(TextureWrapMode.Clamp, TextureWrapMode.Clamp, TextureWrapMode.Clamp, TextureWrapMode.Clamp);
            }

            return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.Sprite, platformSettings, settings, spriteSettings, alphaSettings, mipmapSettings, wrapSettings));
        }