Adds out-of-the-box drag and drop functionality to subclasses of Resource when the user drags the resource from the library to a scene viewport.
Simply apply the decorator to your subclass of Resource and provide a callback that is called when your resource was dropped on a SceneObject.
The following example shows a potential implementation:
\@onViewportDragAndDrop((resource: MyCustomResource, sceneObject: SceneObject) =>{ sceneObject.addComponent(MyCustomComponent).resource = resource;}) Copy
\@onViewportDragAndDrop((resource: MyCustomResource, sceneObject: SceneObject) =>{ sceneObject.addComponent(MyCustomComponent).resource = resource;})
Adds out-of-the-box drag and drop functionality to subclasses of Resource when the user drags the resource from the library to a scene viewport.
Simply apply the decorator to your subclass of Resource and provide a callback that is called when your resource was dropped on a SceneObject.
The following example shows a potential implementation: