I implemented a basic editor extension to help me with some of the workflows of my project. I needed this extension to be loaded without any user interaction, i.e. no custom prefabs or scripts in the scene and no EditorWindow. To achieve this I annotated a class with InitializeOnLoad and subscribed to some editor events.
This works pretty well, but now I need to render some small sprites on the scene view and I’m having trouble accessing the textures to do that. Since I’m not using a MonoBehaviour or ScriptableObject for this extension, I probably can’t set up a reference to those assets anywhere.
I could load them from a hard coded path using AssetDatabase.LoadAssetAtPath, but that doesn’t seem to be a good idea either. If I were to ever release this asset, the user couldn’t move it anywhere from the hard coded path.