指针
This commit is contained in:
@@ -20,7 +20,7 @@ namespace AibisDream
|
||||
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineStart, DialogText.GetLine(dialogueLine));
|
||||
|
||||
HandleLineOutput(dialogueLine, onDialogueLineFinished);
|
||||
HandleLineOutput(dialogueLine, NextStep);
|
||||
|
||||
if (DialogController.Instance.quickRunMode)
|
||||
{
|
||||
@@ -43,6 +43,13 @@ namespace AibisDream
|
||||
}
|
||||
|
||||
Debug.Log($"[对话流程] [{lineId}] ===== 处理完成 =====");
|
||||
return;
|
||||
|
||||
void NextStep()
|
||||
{
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
onDialogueLineFinished();
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleLineOutput(LocalizedLine dialogueLine, Action onDialogueLineFinished)
|
||||
|
||||
@@ -149,7 +149,6 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void HandleDialogueComplete()
|
||||
{
|
||||
Debug.Log("Dialog End");
|
||||
isInDialog = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,8 +127,7 @@ namespace AibisDream.FixSystem
|
||||
ActionKit.Delay(0.1f, () =>
|
||||
{
|
||||
Debug.Log("[ScreenSystem] AfterLineShown - 延迟结束,调用回调");
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
nextStop.Invoke();
|
||||
nextStop?.Invoke();
|
||||
Debug.Log("[ScreenSystem] AfterLineShown - 回调调用完成");
|
||||
}).StartGlobal();
|
||||
typewriter.onTextShowed.RemoveAllListeners();
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace AibisDream
|
||||
if (_taskDict.ContainsKey(lineId))
|
||||
{
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineShown);
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
nextStep.Invoke();
|
||||
return;
|
||||
}
|
||||
@@ -60,7 +59,6 @@ namespace AibisDream
|
||||
|
||||
_taskDict[lineId] = taskItem;
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineShown);
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
nextStep.Invoke();
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(_taskListParent.GetComponent<RectTransform>());
|
||||
}
|
||||
|
||||
@@ -47,14 +47,6 @@ namespace AibisDream.Framework
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 事件注册
|
||||
|
||||
public override void OnSingletonInit()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 单例必须的代码
|
||||
@@ -62,6 +54,10 @@ namespace AibisDream.Framework
|
||||
private EventSystemEx()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSingletonInit()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace AibisDream
|
||||
_trigger = GetComponent<EventTriggerEx>();
|
||||
|
||||
_trigger.Register(EventTriggerType.Drag, OnDrag);
|
||||
_trigger.Register(EventTriggerType.BeginDrag, StartMove);
|
||||
_trigger.Register(EventTriggerType.EndDrag, StopMove);
|
||||
_trigger.Register(EventTriggerType.PointerDown, StartMove);
|
||||
_trigger.Register(EventTriggerType.PointerUp, StopMove);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@@ -108,10 +108,10 @@ namespace AibisDream
|
||||
transform.DOPause();
|
||||
}
|
||||
|
||||
public void StopMove(BaseEventData eventData)
|
||||
private void StopMove(BaseEventData eventData)
|
||||
{
|
||||
// 正常情况下不会出错
|
||||
if (eventData is not PointerEventData pointerData) return;
|
||||
if (eventData is not PointerEventData) return;
|
||||
|
||||
if (targetShaft)
|
||||
{
|
||||
|
||||
@@ -14,15 +14,14 @@ namespace AibisDream
|
||||
{
|
||||
private const float DelayTime = 0.1f;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject border;
|
||||
|
||||
[SerializeField] private GameObject border;
|
||||
|
||||
[Header("指针图片")] public Sprite defaultCursor;
|
||||
public Sprite nextTalk, talking, option, interactive, holding, disable;
|
||||
|
||||
private Image _cursor;
|
||||
private GraphicRaycaster _raycaster;
|
||||
|
||||
|
||||
private Sprite _curCursor;
|
||||
private CursorState _stateCache;
|
||||
|
||||
@@ -113,10 +112,10 @@ namespace AibisDream
|
||||
private void OnGameQuit()
|
||||
{
|
||||
_curCursor = defaultCursor;
|
||||
|
||||
|
||||
_curState = CursorState.Default;
|
||||
_stateCache = CursorState.Default;
|
||||
|
||||
|
||||
_isInGame = false;
|
||||
}
|
||||
|
||||
@@ -165,7 +164,7 @@ namespace AibisDream
|
||||
{
|
||||
if (!_isInGame) return;
|
||||
if (!Input.GetMouseButtonDown(0) && !Input.GetKeyDown(KeyCode.Space)) return;
|
||||
|
||||
|
||||
// 控制对话
|
||||
if (_isTalking)
|
||||
{
|
||||
@@ -179,15 +178,15 @@ namespace AibisDream
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var eventData = new PointerEventData(EventSystem.current)
|
||||
{
|
||||
position = Input.mousePosition
|
||||
};
|
||||
|
||||
|
||||
var results = new List<RaycastResult>();
|
||||
_raycaster.Raycast(eventData, results);
|
||||
|
||||
|
||||
return results.Count > 0 && results.Any(result => result.gameObject.CompareTag("Selectable"));
|
||||
}
|
||||
|
||||
@@ -247,6 +246,10 @@ namespace AibisDream
|
||||
{
|
||||
SwitchCursor(interactive);
|
||||
}
|
||||
else
|
||||
{
|
||||
SwitchCursor(defaultCursor);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInteractiveEnd()
|
||||
|
||||
@@ -176,7 +176,6 @@ namespace AibisDream
|
||||
}
|
||||
|
||||
Debug.Log("[BubbleGroup] NextStep - 发送LineEnd事件");
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
|
||||
var next = _nextStep;
|
||||
_nextStep = null;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace AibisDream
|
||||
if (_nextStep == null) return;
|
||||
|
||||
ClearBox();
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
|
||||
var next = _nextStep;
|
||||
_nextStep = null;
|
||||
next.Invoke();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"Volume": "0.89",
|
||||
"Language": "zh-Hans",
|
||||
"WindowMode": "MaximizedWindow"
|
||||
"WindowMode": "Windowed"
|
||||
}
|
||||
Reference in New Issue
Block a user