As of now, we're using ImGUI directly resulting in duplicate code and some weird hacky'ish stuff.
Ideally, we have a singular clean API to handle all our Drag and Drop content.
Something like:
//ImGUI Widget Here
if(DragAndDrop.RecieveAsset<Texture2D>(out AssetRef<Texture2D> droppedTex))
{
}
//ImGUI Widget Here
if(DragAndDrop.RecieveReference<Texture2D>(out Texture2D droppedTex))
{
}
//ImGUI Widget Here
DragAndDrop.OfferAsset<Texture2D>(offeredTex);
//ImGUI Widget Here
DragAndDrop.OfferReference<Texture2D>(offeredTex);
For dropping files into the editor from outside we should first import the asset.
This should only be called on the window that should receive it not sure how to do that just yet with this style of API.
As of now, we're using ImGUI directly resulting in duplicate code and some weird hacky'ish stuff.
Ideally, we have a singular clean API to handle all our Drag and Drop content. Something like:
For dropping files into the editor from outside we should first import the asset. This should only be called on the window that should receive it not sure how to do that just yet with this style of API.
Using this we can do additional things, like drawing a rectangle over the widget when dragging/dropping stuff.