implemented NPC system and working bartender conversation

This commit is contained in:
2026-08-15 19:02:01 +02:00
parent be63c21e15
commit f89781d78b
18 changed files with 1042 additions and 160 deletions
@@ -1,4 +1,3 @@
using StarterAssets;
using UnityEngine;
using Yarn.Unity;
@@ -13,7 +12,6 @@ namespace NightclubArcadia.Dialogue
{
[SerializeField] private DialogueRunner dialogueRunner;
[SerializeField] private GameObject dialogueUI;
[SerializeField] private GameObject playerArmature;
[SerializeField] private string yarnNodeName = "Bartender_Chat";
private bool playerInRange = false;
@@ -38,14 +36,19 @@ namespace NightclubArcadia.Dialogue
}
}
void StartConversation()
async void StartConversation()
{
var playerController = playerArmature.GetComponent<ThirdPersonController>();
if (playerController != null)
playerController.enabled = false;
// Player controls are locked by DialogueTransitionController off the
// runner's onDialogueStart event — nothing to do for that here.
if (DialogueUIVisibility.Show(dialogueUI))
{
// Only reached if the UI was found deactivated; give TMP a
// frame to re-cache its Canvas in OnEnable before any text is
// generated.
await Awaitable.NextFrameAsync();
}
dialogueUI.SetActive(true);
dialogueRunner.StartDialogue(yarnNodeName);
await dialogueRunner.StartDialogue(yarnNodeName);
}
}
}