diff --git a/SSLR/Assets/Scripts/GameManager.cs b/SSLR/Assets/Scripts/GameManager.cs index 680f45e..7f09c05 100644 --- a/SSLR/Assets/Scripts/GameManager.cs +++ b/SSLR/Assets/Scripts/GameManager.cs @@ -7,6 +7,7 @@ using System.Collections; using System.Collections.Generic; +using TMPro; using UnityEngine; public class GameManager : MonoBehaviour @@ -24,13 +25,26 @@ public class GameManager : MonoBehaviour public GameObject currentNPC; - [Header("Walk Points (FOR DEBUGGING")] + /*[Header("Walk Points (FOR DEBUGGING")] public Transform[] frontWalkPoints; public Transform[] leftWalkPoints; public Transform[] rightWalkPoints; public GameObject leftWalkPointSet; - public GameObject rightWalkPointSet; + public GameObject rightWalkPointSet;*/ + + [Header("NPC Dialogue")] + public TextMeshProUGUI initialStatementText; + + public TextMeshProUGUI playerQuestionOneText; + public TextMeshProUGUI playerQuestionTwoText; + public TextMeshProUGUI playerQuestionThreeText; + + public TextMeshProUGUI npcAnswerOneText; + public TextMeshProUGUI npcAnswerTwoText; + public TextMeshProUGUI npcAnswerThreeText; + + public TextMeshProUGUI playerResponse; /// /// Do Not Destroy on Load diff --git a/SSLR/Assets/Scripts/NPCMovementRework.cs b/SSLR/Assets/Scripts/NPCMovementRework.cs index db2d00a..7d864b1 100644 --- a/SSLR/Assets/Scripts/NPCMovementRework.cs +++ b/SSLR/Assets/Scripts/NPCMovementRework.cs @@ -21,7 +21,8 @@ public class NpcMovementRework : MonoBehaviour private static readonly int IsSitting = Animator.StringToHash("isSitting"); private static readonly int Speed = Animator.StringToHash("Speed"); - + NpcData npcData; + public void Update() { if (agent.velocity.magnitude > 0.1) @@ -105,4 +106,19 @@ public class NpcMovementRework : MonoBehaviour var random = Random.Range(0, NpcManager.instance.despawnPoints.Length); agent.SetDestination(NpcManager.instance.despawnPoints[random].position); } + + public void LoadNPCDialogue() + { + GameManager.instance.initialStatementText.text = npcData.initialStatement; + + GameManager.instance.playerQuestionOneText.text = npcData.question1; + GameManager.instance.playerQuestionTwoText.text = npcData.question2; + GameManager.instance.playerQuestionThreeText.text = npcData.question3; + + GameManager.instance.npcAnswerOneText.text = npcData.answer1; + GameManager.instance.npcAnswerTwoText.text = npcData.answer2; + GameManager.instance.npcAnswerThreeText.text = npcData.answer3; + + GameManager.instance.playerResponse.text = npcData.response3; + } } \ No newline at end of file