Hello all.
I’m having trouble discovering how to set the isReadable flag when creating a procedural asset.(mesh or texture)
In the following code, TextureImporter is null.
AssetDatabase.CreateAsset(nodeDb.Texture.GetTexture(), Config.TexturesDirectory + "/Texture" + nodeDb.NodeIndex + ".asset");
TextureImporter texImporter = AssetImporter.GetAtPath(Config.TexturesDirectory + "/Texture" + nodeDb.NodeIndex + ".asset") as TextureImporter;
If I can’t get TextureImporter, how do I do this? An object is returned but is of (undocumented) type NativeFormatImporter which has an almost completely bare interface.
I built an application that extracts images from a database, compresses them(native to iOS) and saves them directly to the assets directory. When I load them onto the device it appears I’m using way(~2x) too much texture memory - like a copy in memory and for VRAM (yes I understand that VRAM is shared on iOS devices).
This is totally defeating my entire memory saving strategy and really quite bad for me. I just assumed I’d be able to retrieve a TextureImporter.
Perhaps something (hacky) could be done with NativeTexture pointers???
Can anyone please help? It appears a few have been frustrated when building procedural assets. Why not have the read/write flag in Texture? Please?
Any help much appreciated.
Scott