unityzgy/.svn/pristine/1b/1b7f54b3c986f8288e564422d5d58bf913c2ab89.svn-base
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

94 lines
4.3 KiB
Plaintext

namespace VRTK.UnityEventHelper
{
using UnityEngine;
using UnityEngine.Events;
using System;
[AddComponentMenu("VRTK/Scripts/Utilities/Unity Events/VRTK_UIPointer_UnityEvents")]
public sealed class VRTK_UIPointer_UnityEvents : VRTK_UnityEvents<VRTK_UIPointer>
{
[Serializable]
public sealed class UIPointerEvent : UnityEvent<object, UIPointerEventArgs> { }
public UIPointerEvent OnUIPointerElementEnter = new UIPointerEvent();
public UIPointerEvent OnUIPointerElementExit = new UIPointerEvent();
public UIPointerEvent OnUIPointerElementClick = new UIPointerEvent();
public UIPointerEvent OnUIPointerElementDragStart = new UIPointerEvent();
public UIPointerEvent OnUIPointerElementDragEnd = new UIPointerEvent();
public VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent OnActivationButtonPressed = new VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent();
public VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent OnActivationButtonReleased = new VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent();
public VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent OnSelectionButtonPressed = new VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent();
public VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent OnSelectionButtonReleased = new VRTK_ControllerEvents_UnityEvents.ControllerInteractionEvent();
protected override void AddListeners(VRTK_UIPointer component)
{
component.UIPointerElementEnter += UIPointerElementEnter;
component.UIPointerElementExit += UIPointerElementExit;
component.UIPointerElementClick += UIPointerElementClick;
component.UIPointerElementDragStart += UIPointerElementDragStart;
component.UIPointerElementDragEnd += UIPointerElementDragEnd;
component.ActivationButtonPressed += ActivationButtonPressed;
component.ActivationButtonReleased += ActivationButtonReleased;
component.SelectionButtonPressed += SelectionButtonPressed;
component.SelectionButtonReleased += SelectionButtonReleased;
}
protected override void RemoveListeners(VRTK_UIPointer component)
{
component.UIPointerElementEnter -= UIPointerElementEnter;
component.UIPointerElementExit -= UIPointerElementExit;
component.UIPointerElementClick -= UIPointerElementClick;
component.UIPointerElementDragStart -= UIPointerElementDragStart;
component.UIPointerElementDragEnd -= UIPointerElementDragEnd;
component.ActivationButtonPressed -= ActivationButtonPressed;
component.ActivationButtonReleased -= ActivationButtonReleased;
component.SelectionButtonPressed -= SelectionButtonPressed;
component.SelectionButtonReleased -= SelectionButtonReleased;
}
private void UIPointerElementEnter(object o, UIPointerEventArgs e)
{
OnUIPointerElementEnter.Invoke(o, e);
}
private void UIPointerElementExit(object o, UIPointerEventArgs e)
{
OnUIPointerElementExit.Invoke(o, e);
}
private void UIPointerElementClick(object o, UIPointerEventArgs e)
{
OnUIPointerElementClick.Invoke(o, e);
}
private void UIPointerElementDragStart(object o, UIPointerEventArgs e)
{
OnUIPointerElementDragStart.Invoke(o, e);
}
private void UIPointerElementDragEnd(object o, UIPointerEventArgs e)
{
OnUIPointerElementDragEnd.Invoke(o, e);
}
private void ActivationButtonPressed(object o, ControllerInteractionEventArgs e)
{
OnActivationButtonPressed.Invoke(o, e);
}
private void ActivationButtonReleased(object o, ControllerInteractionEventArgs e)
{
OnActivationButtonReleased.Invoke(o, e);
}
private void SelectionButtonPressed(object o, ControllerInteractionEventArgs e)
{
OnSelectionButtonPressed.Invoke(o, e);
}
private void SelectionButtonReleased(object o, ControllerInteractionEventArgs e)
{
OnSelectionButtonReleased.Invoke(o, e);
}
}
}