feat(Read): 添加阅读中无法移动和移动视线的设置

This commit is contained in:
2025-10-25 10:46:17 +08:00
parent 08314151dc
commit cdf1514467
2 changed files with 147 additions and 4 deletions

View File

@@ -19,6 +19,9 @@ namespace Script.Gameplay.Player
public event Action OnPlayerEndDialogue;
public event Action<GameObject> OnGazeEnterDialogue;
public event Action<GameObject> OnGazeExitDialogue;
private InputManager inputManager;
private Queue<string> dialogueQueue = new Queue<string>();
private PlayerDialogueViewer playerDialogueViewer;
@@ -55,7 +58,8 @@ namespace Script.Gameplay.Player
if (firstPersonRaycaster == null)
Debug.LogWarning("FirstPersonRaycaster not found! Please assign or add it to the player.");
var input = InputManager.Instance.Input;
inputManager = InputManager.Instance;
var input = inputManager.Input;
input.Player.Read.performed += ctx =>
{
if (!isEnablePlayerDialogue) return;
@@ -95,6 +99,8 @@ namespace Script.Gameplay.Player
OnPlayerBeginDialogue?.Invoke();
CurrentDialogueTarget.OnBeginDialogue?.Invoke(true);
dialogueQueue = SplitDialogue(CurrentDialogueTarget.DialogueContent);
inputManager.SetInputForLook(false);
inputManager.SetInputForMove(false);
PassNextDialogue();
}
}
@@ -124,6 +130,8 @@ namespace Script.Gameplay.Player
isReadingDialogue = false;
OnPlayerEndDialogue?.Invoke();
CurrentDialogueTarget.OnEndDialogue?.Invoke(true);
inputManager.SetInputForLook(true);
inputManager.SetInputForMove(true);
if (playerDialogueViewer != null)
{
playerDialogueViewer.ClosePanel();