diff --git a/Assets/Scene 1 Assets/Dialogue.cs b/Assets/Scene 1 Assets/Dialogue.cs index a187088..354e907 100644 --- a/Assets/Scene 1 Assets/Dialogue.cs +++ b/Assets/Scene 1 Assets/Dialogue.cs @@ -6,23 +6,49 @@ using TMPro; public class Dialogue : MonoBehaviour { public TMP_Text textbox; - ArrayList pages; + List pages; int curPage; + public bool isOpen = true; + //test object + public GameObject textTest; // Start is called before the first frame update void Start() { //pages to scroll through - pages = new ArrayList(); + pages = new List(); + curPage = 0; } //Adds a page of text - void AddText(string text) + void AddPage(string text) { pages.Add(text); } // Update is called once per frame void Update() { - + //only pauses if opened + if(isOpen) + { + //pause + Movement.pause = true; + // if(Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0 || Input.GetKeyDown(KeyCode.Return)) + // { + // //scroll through textbox using any movement key + // if(curPage >= pages.Count - 1) + // { + // isOpen = false; + // } + // else + // { + // textbox.text = pages[++curPage]; + // } + // } + } + //unpause + else + { + Movement.pause = false; + } } } diff --git a/Assets/Scene 1 Assets/Enemy.cs b/Assets/Scene 1 Assets/Enemy.cs index b581994..9d160ae 100644 --- a/Assets/Scene 1 Assets/Enemy.cs +++ b/Assets/Scene 1 Assets/Enemy.cs @@ -1,3 +1,5 @@ +//WIP + using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/Assets/Scene 1 Assets/Friend.cs b/Assets/Scene 1 Assets/Friend.cs index 9c7a072..376ec9f 100644 --- a/Assets/Scene 1 Assets/Friend.cs +++ b/Assets/Scene 1 Assets/Friend.cs @@ -1,3 +1,5 @@ +//WIP + using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/Assets/Scene 1 Assets/NPC.cs b/Assets/Scene 1 Assets/NPC.cs index e99c11d..2699ecf 100644 --- a/Assets/Scene 1 Assets/NPC.cs +++ b/Assets/Scene 1 Assets/NPC.cs @@ -1,10 +1,25 @@ +//WIP + using System.Collections; using System.Collections.Generic; using UnityEngine; public class NPC : MonoBehaviour { - // Start is called before the first frame update + + public Movement controller; + float horizontalMove = 0f; + public float runSpeed = 40f; + public string title = ""; + + //constructs an NPC using parameters + public NPC(string name, float run, float hor) + { + title = name; + runSpeed = run; + horizontalMove = hor; + } + void Start() { @@ -15,4 +30,10 @@ public class NPC : MonoBehaviour { } + + //NPC movement determined by script in subclasses + void FixedUpdate() + { + controller.Move(horizontalMove *Time.fixedDeltaTime, false, false); + } } diff --git a/Assets/Scene 1 Assets/Textbox.prefab b/Assets/Scene 1 Assets/Textbox.prefab index ee78c9b..5c093ae 100644 --- a/Assets/Scene 1 Assets/Textbox.prefab +++ b/Assets/Scene 1 Assets/Textbox.prefab @@ -495,6 +495,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: textbox: {fileID: 7059772333148747626} + isOpen: 0 + textTest: {fileID: 7059772332581294260} --- !u!1 &7059772333148747624 GameObject: m_ObjectHideFlags: 0 @@ -561,7 +563,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: a quick brown fox jumped over the lazy dog + m_text: a quick brown fox jumps over the lazy dog m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8bd1780577b8eaf43ad60554189eb11e, type: 2} m_sharedMaterial: {fileID: 1974643164809013703, guid: 8bd1780577b8eaf43ad60554189eb11e, type: 2} diff --git a/Assets/Scenes/Scene1.unity b/Assets/Scenes/Scene1.unity index 8dd5650..39c4069 100644 --- a/Assets/Scenes/Scene1.unity +++ b/Assets/Scenes/Scene1.unity @@ -266,6 +266,7 @@ MonoBehaviour: m_EditorClassIdentifier: controller: {fileID: 187176290} runSpeed: 40 + textTest: {fileID: 7059772332933783825} --- !u!1 &519420028 GameObject: m_ObjectHideFlags: 0 @@ -839,3 +840,8 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6ea336e93a8128346aad568255a7e6af, type: 3} +--- !u!1 &7059772332933783825 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7059772333487008123, guid: 6ea336e93a8128346aad568255a7e6af, type: 3} + m_PrefabInstance: {fileID: 7059772332933783824} + m_PrefabAsset: {fileID: 0}