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; }
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)); }
void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings) { settings.textureImporterSettings.wrapMode = wrapMode; settings.textureImporterSettings.wrapModeU = wrapModeU; settings.textureImporterSettings.wrapModeV = wrapModeV; settings.textureImporterSettings.wrapModeW = wrapModeW; }
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; }
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; }
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; }
void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings) { settings.textureImporterSettings.normalMapFilter = filter; settings.textureImporterSettings.convertToNormalMap = generateFromGrayScale; settings.textureImporterSettings.heightmapScale = bumpiness; }
void ITextureSettings.FillTextureGenerationSettings(ref UnityEditor.AssetImporters.TextureGenerationSettings settings) { settings.textureImporterSettings.alphaIsTransparency = alphaSource != TextureImporterAlphaSource.None; settings.textureImporterSettings.alphaSource = alphaSource; settings.textureImporterSettings.alphaTestReferenceValue = alphaTolerance; }