I have a Prefab that’s just a gameobject with a SpriteRenderer (called TreePrefab)
I have ScriptableObjects for each tree type (so OakTree, PineTree, etc)… each holds various sprites for the prefab to display
When I drag the ScriptableObject onto an instance of the prefab within the inspector, is there a way for it to automatically populate the spriterenderer with the sprite? I know how to do it during runtime, but I’d like to be able to do it within inspector without having to manually set the SpriteRenderer each time… I know ScriptableObjects have an OnEnable(), but is there a way to access the SpriteRenderer from there?
Edit: Or alternatively - anyone know is there an Editor method that gets called when you associate a component with a gameobject?