예제 #1
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.textureShape       = TextureImporterShape.TextureCube;
     settings.textureImporterSettings.cubemapConvolution = convolution;
     settings.textureImporterSettings.generateCubemap    = mode;
     settings.textureImporterSettings.seamlessCubemap    = seamless;
 }
예제 #2
0
        static UnityEditor.AssetImporters.TextureGenerationOutput GenerateTexture(NativeArray <Color32> imageBuffer, int imageBufferWidth, int imageBufferHeight, TextureImporterType type, TextureImporterPlatformSettings platformSettings, params ITextureSettings[] otherSettings)
        {
            var textureGenerationSettings = new UnityEditor.AssetImporters.TextureGenerationSettings();

            textureGenerationSettings.platformSettings = platformSettings;

            textureGenerationSettings.sourceTextureInformation        = new UnityEditor.AssetImporters.SourceTextureInformation();
            textureGenerationSettings.sourceTextureInformation.height = imageBufferHeight;
            textureGenerationSettings.sourceTextureInformation.width  = imageBufferWidth;

            textureGenerationSettings.textureImporterSettings              = new TextureImporterSettings();
            textureGenerationSettings.textureImporterSettings.textureType  = type;
            textureGenerationSettings.textureImporterSettings.textureShape = TextureImporterShape.Texture2D;

            textureGenerationSettings.textureImporterSettings.alphaIsTransparency = false;
            textureGenerationSettings.textureImporterSettings.convertToNormalMap  = false;
            textureGenerationSettings.textureImporterSettings.mipmapEnabled       = false;
            textureGenerationSettings.textureImporterSettings.sRGBTexture         = true;
            textureGenerationSettings.textureImporterSettings.readable            = false;
            textureGenerationSettings.textureImporterSettings.fadeOut             = false;
            textureGenerationSettings.textureImporterSettings.wrapMode            = TextureWrapMode.Repeat;
            textureGenerationSettings.textureImporterSettings.wrapModeU           = TextureWrapMode.Repeat;
            textureGenerationSettings.textureImporterSettings.wrapModeV           = TextureWrapMode.Repeat;
            textureGenerationSettings.textureImporterSettings.wrapModeW           = TextureWrapMode.Repeat;

            foreach (var otherSetting in otherSettings)
            {
                if (otherSetting != null)
                {
                    otherSetting.FillTextureGenerationSettings(ref textureGenerationSettings);
                }
            }
            return(UnityEditor.AssetImporters.TextureGenerator.GenerateTexture(textureGenerationSettings, imageBuffer));
        }
예제 #3
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.wrapMode  = wrapMode;
     settings.textureImporterSettings.wrapModeU = wrapModeU;
     settings.textureImporterSettings.wrapModeV = wrapModeV;
     settings.textureImporterSettings.wrapModeW = wrapModeW;
 }
예제 #4
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.spritePixelsPerUnit = pixelsPerUnit;
     settings.textureImporterSettings.spriteMeshType      = meshType;
     settings.textureImporterSettings.spriteExtrude       = extrudeEdges;
     settings.spritePackingTag        = packingTag;
     settings.qualifyForSpritePacking = qualifyForPacking;
     settings.spriteImportData        = spriteSheetData;
 }
예제 #5
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.mipmapEnabled           = true;
     settings.textureImporterSettings.mipmapFilter            = filter;
     settings.textureImporterSettings.borderMipmap            = borderMipmap;
     settings.textureImporterSettings.fadeOut                 = fadeout;
     settings.textureImporterSettings.mipmapFadeDistanceStart = fadeDistanceStart;
     settings.textureImporterSettings.mipmapFadeDistanceEnd   = fadeDistanceEnd;
     settings.textureImporterSettings.mipMapsPreserveCoverage = preserveCoverage;
 }
예제 #6
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.sRGBTexture = colorTexture;
     settings.textureImporterSettings.readable    = readable;
     settings.textureImporterSettings.npotScale   = npotScale;
     settings.textureImporterSettings.filterMode  = filterMode;
     settings.textureImporterSettings.aniso       = aniso;
     settings.assetPath           = assetPath;
     settings.enablePostProcessor = enablePostProcessor;
     settings.sourceTextureInformation.containsAlpha = containsAlpha;
     settings.sourceTextureInformation.hdr           = hdr;
     settings.secondarySpriteTextures = secondaryTextures;
 }
예제 #7
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.normalMapFilter    = filter;
     settings.textureImporterSettings.convertToNormalMap = generateFromGrayScale;
     settings.textureImporterSettings.heightmapScale     = bumpiness;
 }
예제 #8
0
 void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings)
 {
     settings.textureImporterSettings.alphaIsTransparency     = alphaSource != TextureImporterAlphaSource.None;
     settings.textureImporterSettings.alphaSource             = alphaSource;
     settings.textureImporterSettings.alphaTestReferenceValue = alphaTolerance;
 }