I’m loading a png texture from disk in an editor extension, assigning it to a public field on a gameobject. Then I set this texture to the _mainxTexture slot of material using setTexture(), ( I have a reference to the material through a public inspector on a gameobject). The material is created manually in the editor.
The material is updated, it shows the texture, the mesh using the material shows the texture after my editor script runs.
When I goto file save, I get cleaning leaked objects messages for textures, and the material loses the reference to the texture, and the mesh loses the texture.
What am I missing?