Im not that good at coding your plugin, how would i achieve this easy? I spend last 5 days rebuilding after update. please help me.You can learn morea bout drag&drop in this video:
and in the documentation:Videos - Opsive
opsive.com
Move Items (Drag & Drop) - Opsive
Items can be moved within and between Item View Slots Containers using drag & drop (mouse) or with special Item View Slots Container Item Actions . . .opsive.com
To create your Trash Can you can inspire yourself from the "Scene Drop Action Item View Slot" prefab. You will find it in the RPG schema assets. It uses an Item View Slot + Item View Drop Handler + Item View Slot Drop Handler Binding.
You can use a custom Drop Action to open a popup either by spawning a prefab or by enabling a popup in the scene. You should have a reference to the ItemViewDropHandler component inside the custom Drop Action you will make. Then you can remove the item once you press yes, or cancel if you press no.
You can use a "ConfirmationPopUp" prefab if you want or you can create your own script that's up to you.
I hope that helps
[Serializable]
public class MyCustomItemViewDropAction : ItemViewDropAction
{
/// <summary>
/// Drop Action.
/// </summary>
/// <param name="itemViewDropHandler">The Item View Drop Handler.</param>
public override void Drop(ItemViewDropHandler itemViewDropHandler)
{
var myCustomComponent = itemViewDropHandler.GetComponent<MyCustomComponent>();
if (myCustomComponent == null) {
Debug.LogError("The component was not found.")
return;
}
var itemInfo = itemViewDropHandler.SourceItemInfo;
myCustomComponent.TryConfirmDropRemove(itemInfo);
}
/// <summary>
/// To string.
/// </summary>
/// <returns>The string.</returns>
public override string ToString()
{
return "My Custom Try Confirm Drop";
}