Class TexturePreProcessImporter
Feature that changes properties of textures that have specific suffix. For "_nor" changes texture type to NormalMap. For "_mas", "_mts", "_aoc" changes sRGB (ColorTexture) to false.
public class TexturePreProcessImporter : AssetPostprocessor
- Inheritance
-
AssetPostprocessorTexturePreProcessImporter
- Extension Methods
Fields
MATERIAL_EXTENSION
private const string MATERIAL_EXTENSION = ".mat"
Field Value
URP_LIT_SHADER
private const string URP_LIT_SHADER = "Universal Render Pipeline/Lit"
Field Value
Properties
BaseMap
private int BaseMap { get; }
Property Value
BumpMap
private int BumpMap { get; }
Property Value
CurrentAutomaticTextureAssignSettings
private AutomaticTextureAssignSettings CurrentAutomaticTextureAssignSettings { get; }
Property Value
EmissionMap
private int EmissionMap { get; }
Property Value
ExpectedSuffixesForAlbedo
private string[] ExpectedSuffixesForAlbedo { get; }
Property Value
- string[]
ExpectedSuffixesForEmission
private string[] ExpectedSuffixesForEmission { get; }
Property Value
- string[]
ExpectedSuffixesForHeightMaps
private string[] ExpectedSuffixesForHeightMaps { get; }
Property Value
- string[]
ExpectedSuffixesForMetallicGloss
private string[] ExpectedSuffixesForMetallicGloss { get; }
Property Value
- string[]
ExpectedSuffixesForNormalMaps
private string[] ExpectedSuffixesForNormalMaps { get; }
Property Value
- string[]
ExpectedSuffixesForOcclusion
private string[] ExpectedSuffixesForOcclusion { get; }
Property Value
- string[]
ExpectedSuffixesForSrgbColorSpace
private string[] ExpectedSuffixesForSrgbColorSpace { get; }
Property Value
- string[]
HeightMap
private int HeightMap { get; }
Property Value
MetallicGlossMap
private int MetallicGlossMap { get; }
Property Value
OcclusionMap
private int OcclusionMap { get; }
Property Value
Methods
ApplyTextureOnMaterial(TextureImporter, AutomaticTextureApplyPreset)
private void ApplyTextureOnMaterial(TextureImporter importer, AutomaticTextureApplyPreset automaticTextureApplyPreset)
Parameters
importerTextureImporterautomaticTextureApplyPresetAutomaticTextureApplyPreset
AutomaticAssignTexturesToMaterial()
private void AutomaticAssignTexturesToMaterial()
CheckIfChangesNeeded(string, string[])
private bool CheckIfChangesNeeded(string name, string[] expectedSuffixes)
Parameters
Returns
GetContainingFolderPath(string)
private string GetContainingFolderPath(string texturePath)
Parameters
texturePathstring
Returns
GetFileName(string)
private string GetFileName(string texturePath)
Parameters
texturePathstring
Returns
GetMaterial(TextureImporter)
private Material GetMaterial(TextureImporter importer)
Parameters
importerTextureImporter
Returns
- Material
GetShaderPropertyID(string)
private int GetShaderPropertyID(string shaderProperty)
Parameters
shaderPropertystring
Returns
OnPostprocessTexture(Texture2D)
private void OnPostprocessTexture(Texture2D texture)
Parameters
textureTexture2D
OnPreprocessTexture()
private void OnPreprocessTexture()
SetProperlySettingsOnImportedTexture()
private void SetProperlySettingsOnImportedTexture()