When I pick up an image from the assets view and drop it in the scene, by default Unity instantiates a Gameobject with a SpriteRenderer. Is it possible to customize this using an editor script? To be specific, I’d like it to spawn as a UI System Image, with some of my own Components on top.
It is possible using the UnityEditor.DragAndDrop class.
This class probably would be more known if googling ‘drag and drop’ didn’t get so many hits for runtime tutorials.
1 Like