This example provide that hook drag end event from windows api.
See native plugin builder too.
2021-06-25.05-24-59.mp4
See FileBridge.cs.
FileBridge.Enable()
: Enable hookFileBridge.Disable()
: Disable hookFileBridge.OnDragFiles
: Callback event when dragging end.
See FileBridgeExample.cs.
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace DLavender.Windows
{
public class FileBridgeExample : MonoBehaviour
{
public Text board = default;
private void OnEnable()
{
FileBridge.Enable();
FileBridge.OnDragFiles += OnDragCallback;
}
private void OnDisable()
{
FileBridge.Disable();
}
private void OnDragCallback(List<string> paths)
{
board.text = "";
foreach (string path in paths)
{
board.text += path;
board.text += "\n";
}
}
}
}