I have a project where I need to import various assets (models/textures) and assemble them programmatically into a prefab.
I’m running into a problem where when importing a Texture2D asset, the TextureImporter class does not include the same options available in the inspector view.
So far, all I can set is the textureType:
public class TextureImportProcessor : AssetPostprocessor
{
public void OnPreprocessTexture()
{
// ...
if(fileImportedName.Contains("Cookie"))
{
textureImporter.textureType = TextureImporterType.Cookie;
}
// ...
}
}
The issue I’m running into is that the Light Type that I see in the inspector is set to Directional, when I need a Spotlight.
Is there any way to set this in a script?