using System;
namespace Editor.MapEditor;
[AttributeUsage( AttributeTargets.Class, AllowMultiple = true )]
public class CanDropAttribute : Attribute, ITypeAttribute
{
public Type TargetType { get; set; }
public string PackageTypeOrExtension { get; init; }
///
/// Can drop a package or asset extension of this type.
///
public CanDropAttribute( string packageType )
{
PackageTypeOrExtension = packageType;
}
}
///
/// Provides an interface for dragging and dropping or on a map view.
/// Use with to register your drop target for a or type.
///
public interface IMapViewDropTarget
{
// TODO: I don't like that there's 2 methods here...
///
/// An asset started being dragged over a Hammer view..
///
public void DragEnter( Asset asset, MapView view ) { }
///
/// An sbox.game package started being dragged over a Hammer view..
///
public void DragEnter( Package package, MapView view ) { }
///
/// Called when the mouse cursor moves over a Hammer view while dragging an asset or a package.
///
public void DragMove( MapView view ) { }
///
/// Called when a dragged an asset or a package gets finally dropped on a Hammer view.
///
public void DragDropped( MapView view ) { }
///
/// Called when a dragged an asset or a package gets dragged outside of a Hammer view.
/// This is a good spot to clean up any created nodes.
///
public void DragLeave( MapView view ) { }
public void DrawGizmos( MapView view ) { }
}