diff --git a/Assets/Data.meta b/Assets/Data.meta new file mode 100644 index 0000000..bdfee95 --- /dev/null +++ b/Assets/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72bd0343ae503704c804354c27d429a8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Data/Derk.asset b/Assets/Data/Derk.asset new file mode 100644 index 0000000..7ee457d --- /dev/null +++ b/Assets/Data/Derk.asset @@ -0,0 +1,29 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ddda90cbbcf3ea54e9105c3a5f0ac9a5, type: 3} + m_Name: Derk + m_EditorClassIdentifier: + m_name: Derk + m_charisma: 5 + m_strength: 5 + m_dexterity: 3 + m_intelligence: 5 + m_money: 5 + m_dialogueOptions: + - text: "Name\u2019s Derk" + - text: "Man, I just want to work, y\u2019know? Give me a task and I\u2019ll do + it, no problem for old Derk." + - text: "This mornin\u2019 I helped an old lady get into one of those high speed + trains. They always say Derk the jerk, but no one ever says \u201CWow, what + a nice guy\u201D. " + - text: "\u2026 (drools)" + - text: I just want money, whatevs diff --git a/Assets/Data/Derk.asset.meta b/Assets/Data/Derk.asset.meta new file mode 100644 index 0000000..1b45dfe --- /dev/null +++ b/Assets/Data/Derk.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe5c0edf44ede8146ac344d9538dafc6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/DialogueSystem/DialogueController.cs b/Assets/Scripts/DialogueSystem/DialogueController.cs index 21160db..11a251b 100644 --- a/Assets/Scripts/DialogueSystem/DialogueController.cs +++ b/Assets/Scripts/DialogueSystem/DialogueController.cs @@ -5,10 +5,16 @@ using UnityEngine; public class DialogueController : MonoBehaviour { [SerializeField] private DialoguePanel m_dialoguePanel; + [SerializeField] private List m_characterDatas; - // TODO: - // - Load the correct character based on the character who has been interacted with - // - Display the 5 question options and hook up their responses - // - Fill out a character sheet as you go along - // - Update the visual with the text + // DEBUG - Will need replacing with the character you selected. + private void Start() + { + DisplayCharacterText(m_characterDatas[0]); + } + + public void DisplayCharacterText(CharacterData character) + { + m_dialoguePanel.Setup(character); + } } diff --git a/Assets/Scripts/DialogueSystem/UI/DialoguePanel.cs b/Assets/Scripts/DialogueSystem/UI/DialoguePanel.cs index 7bf2541..842813e 100644 --- a/Assets/Scripts/DialogueSystem/UI/DialoguePanel.cs +++ b/Assets/Scripts/DialogueSystem/UI/DialoguePanel.cs @@ -12,16 +12,18 @@ public class DialoguePanel : MonoBehaviour [SerializeField] private TMP_Text m_characterNameText; [SerializeField] private TMP_Text m_characterText; - private const float TypingSpeed = 0.02f; + private const float TypingSpeed = 0.03f; private CharacterData m_currentCharacter; private bool m_skipped = false; - private void Start() + private void Awake() { PopulateQuestionButtons(); + gameObject.SetActive(false); } + // Sets the reference to the characterData to use. public void Setup(CharacterData characterData) { Cleanup(); @@ -31,8 +33,11 @@ public class DialoguePanel : MonoBehaviour // TODO: will this be changed with an introductory text? m_characterText.text = "Select an option..."; + + gameObject.SetActive(true); } + // Handles cleaing up for the next text. private void Cleanup() { m_skipped = false; @@ -53,7 +58,11 @@ public class DialoguePanel : MonoBehaviour buttonText.text = QuestionData.Questions[i]; var button = buttonObj.GetComponent