事件系统扩展

This commit is contained in:
2025-01-16 11:37:14 +08:00
parent 13bf57e84a
commit cb3eff896d
5 changed files with 65 additions and 197 deletions
+7 -5
View File
@@ -22,7 +22,6 @@ namespace AibisDream
private CursorState _curState = CursorState.Default;
#endregion
// 卸载时注销事件
private List<IUnRegister> _unRegisters = new();
@@ -68,10 +67,13 @@ namespace AibisDream
_unRegisters.Add(EnumEventSystem.Global.Register<DialogEventEnum, DialogLine>(DialogEventEnum.LineStart,
_ => SwitchCursor(talking)));
_unRegisters.Add(EnumEventSystem.Global.Register(DialogEventEnum.LineShowed, () => SwitchCursor(nextTalk)));
_unRegisters.Add(EnumEventSystem.Global.Register(DialogEventEnum.LineEnd, () => SwitchCursorDelay(defaultCursor)));
_unRegisters.Add(EnumEventSystem.Global.Register(DialogEventEnum.LineEnd,
() => SwitchCursorDelay(defaultCursor)));
_unRegisters.Add(EnumEventSystem.Global.Register(DialogEventEnum.OptionShow, () => SwitchCursor(option)));
_unRegisters.Add(EnumEventSystem.Global.Register(DialogEventEnum.OptionSelected, () => SwitchCursorDelay(defaultCursor)));
_unRegisters.Add(
EnumEventSystem.Global.Register<DialogEventEnum, DialogLine>(DialogEventEnum.OptionSelected,
_ => SwitchCursorDelay(defaultCursor)));
// 交互相关
_unRegisters.Add(EnumEventSystem.Global.Register(InteractionEventEnum.Start, OnInteractiveStart));
_unRegisters.Add(EnumEventSystem.Global.Register(InteractionEventEnum.End, OnInteractiveEnd));
@@ -84,7 +86,7 @@ namespace AibisDream
CameraKit.Instance.uiCamera, out var worldPos);
_cursor.rectTransform.localPosition = worldPos;
// 在输入状态,要单独处理
}