mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-11-11 04:22:40 +00:00
Worked on base movement for npcs and figured out activating/deactivating textbox
This commit is contained in:
1 parent
d53725e3f0
commit
6af09046ce
6 files changed
+65
-6
No files matched your search
@@ -6,23 +6,49 @@ using TMPro;
|
||||
public class Dialogue : MonoBehaviour
|
||||
{
|
||||
public TMP_Text textbox;
|
||||
ArrayList<string> pages;
|
||||
List<string> 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<string>();
|
||||
pages = new List<string>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user