using UnityEngine;
using System;
namespace AibisDream
{
///
/// 拖拽状态
///
public enum DragState
{
Idle, // 空闲
Dragging, // 拖拽中
Placed // 已放置
}
///
/// 交互模式:由外界赋值控制每个 shape 是拖拽还是点击状态
///
public enum InteractionMode
{
Drag, // 长按拿起、点击放下(当前逻辑)
Click // 仅点击,触发 OnClick + 反馈
}
///
/// 拖拽结束结果类型
///
public enum DragEndResultType
{
None, // 未处理
Recycled, // 已回收
SnappedToGrid, // 已吸附到网格
Dropped, // 直接放下(未吸附)
Cancelled // 取消拖拽
}
///
/// 拖拽结束事件参数
///
public class DragEndEventArgs : EventArgs
{
///
/// 被拖拽的形状
///
public BlockShape Shape { get; set; }
///
/// 拖拽结束时的世界坐标位置
///
public Vector3 EndPosition { get; set; }
///
/// 最终的拖拽状态(由处理器设置)
///
public DragState FinalState { get; set; }
///
/// 是否已被处理(如回收、吸附等)
///
public bool IsHandled { get; set; }
///
/// 处理结果类型
///
public DragEndResultType ResultType { get; set; }
}
///
/// 拖拽开始事件参数
///
public class DragStartEventArgs : EventArgs
{
public BlockShape Shape { get; set; }
public Vector3 StartPosition { get; set; }
}
///
/// 拖拽更新事件参数
///
public class DragUpdateEventArgs : EventArgs
{
public BlockShape Shape { get; set; }
public Vector3 CurrentPosition { get; set; }
///
/// 当前的吸附检测结果(由Grid提供)
///
public SnapResult CurrentSnapResult { get; set; }
}
}