unityzgy/Assets/ThirdPackages/VRPackage/VRTK/Scripts/UI/VRTK_UIDropZone.cs
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

43 lines
1.5 KiB
C#

// UI Drop Zone|UI|80040
namespace VRTK
{
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// A UI Drop Zone is applied to any UI element that is to be considered a valid parent for any UI Draggable element to be dropped into it.
/// </summary>
/// <remarks>
/// It's usually appropriate to use a Panel UI element as a drop zone with a layout group applied so new children dropped into the drop zone automatically align.
/// </remarks>
/// <example>
/// `VRTK/Examples/034_Controls_InteractingWithUnityUI` demonstrates a collection of UI Drop Zones.
/// </example>
[AddComponentMenu("VRTK/Scripts/UI/VRTK_UIDropZone")]
public class VRTK_UIDropZone : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
protected VRTK_UIDraggableItem droppableItem;
public virtual void OnPointerEnter(PointerEventData eventData)
{
if (eventData.pointerDrag)
{
var dragItem = eventData.pointerDrag.GetComponent<VRTK_UIDraggableItem>();
if (dragItem && dragItem.restrictToDropZone)
{
dragItem.validDropZone = gameObject;
droppableItem = dragItem;
}
}
}
public virtual void OnPointerExit(PointerEventData eventData)
{
if (droppableItem)
{
droppableItem.validDropZone = null;
}
droppableItem = null;
}
}
}