Finished Textbox interaction

changed movement to pause it
This commit is contained in:
Rizvee committed 2022-02-23 20:09:45 -06:00
1 parent 3a81f1a122
commit 6a18528098
5 files changed
+77 -38

No files matched your search

+3 -3
View File
@@ -6,6 +6,7 @@ using TMPro;
public class Dialogue : MonoBehaviour
{
public Animator animator;
public RuntimeAnimatorController controller;
public TMP_Text textbox;
public TMP_Text arrow;
public AudioManager audioManager;
@@ -16,7 +17,6 @@ public class Dialogue : MonoBehaviour
//used to activate/deactivate test object
//activate through outside means probably
public GameObject textTest;
public GameObject headText;
//used to print the first x letters of the text
int cCount = 0;
//changes the pace at which chars appear
@@ -32,6 +32,7 @@ public class Dialogue : MonoBehaviour
{
arrow.text = "";
}
animator.runtimeAnimatorController = controller;
}
//Adds a page of text
@@ -73,8 +74,7 @@ public class Dialogue : MonoBehaviour
//exits the textbox
isOpen = false;
Movement.pause = false;
textTest.SetActive(false);
headText.SetActive(false);
Destroy(textTest);
cCount = 0;
curPage = 0;
}
+6 -1
View File
@@ -142,7 +142,12 @@ public class Movement : MonoBehaviour
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
dj = true;
}
}
}
else
{
m_Velocity = Vector3.zero;
m_Rigidbody2D.velocity = m_Velocity;
}
}
+5 -11
View File
@@ -5,31 +5,25 @@ using UnityEngine;
public class TextTrigger : Trigger
{
public GameObject TextBox;
public GameObject HeadBox;
// public GameObject HeadBox;
public List<string> pages;
public List<int> emotes;
public Animator animator;
public RuntimeAnimatorController controller;
public Sprite startSprite;
public AudioManager audioManager;
public bool isTalking;
GameObject instance;
GameObject headInstance;
// GameObject instance;
// GameObject headInstance;
void Instant() {
instance = Instantiate(TextBox, TextBox.transform.position, Quaternion.identity);
headInstance = Instantiate(HeadBox, HeadBox.transform.position, Quaternion.identity);
instance.SetActive(true);
instance.GetComponent<Dialogue>().pages = pages;
instance.GetComponent<Dialogue>().emotes = emotes;
headInstance.GetComponent<Animator>().runtimeAnimatorController = controller;
instance.GetComponent<Dialogue>().animator = animator;
instance.GetComponent<Dialogue>().animator.gameObject.SetActive(true);
instance.GetComponent<Dialogue>().controller = controller;
instance.GetComponent<Dialogue>().audioManager = audioManager;
headInstance.GetComponent<SpriteRenderer>().sprite = startSprite;
instance.SetActive(true);
headInstance.SetActive(false);
instance.GetComponent<Dialogue>().isOpen = true;
instance.GetComponent<Dialogue>().isTalking = isTalking;
}
public override void Action()
{
+27 -4
View File
@@ -432,7 +432,7 @@ GameObject:
- component: {fileID: 7479122399646608139}
- component: {fileID: 6609646662535657406}
- component: {fileID: 9064808559075345882}
m_Layer: 0
m_Layer: 5
m_Name: Head Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -630,12 +630,13 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7059772332581294260}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4098cb6d8f351b44ca98b3bb6311f330, type: 3}
m_Name:
m_EditorClassIdentifier:
animator: {fileID: 9032403516113401987}
controller: {fileID: 0}
textbox: {fileID: 7059772333148747626}
arrow: {fileID: 7395190149993767727}
audioManager: {fileID: 0}
@@ -643,7 +644,6 @@ MonoBehaviour:
emotes:
isOpen: 0
textTest: {fileID: 7059772332581294260}
headText: {fileID: 6300146333193859577}
isTalking: 0
--- !u!1 &7059772333148747624
GameObject:
@@ -840,7 +840,8 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 7059772333487008124}
m_Layer: 0
- component: {fileID: 9060944746453456260}
m_Layer: 5
m_Name: Textbox
m_TagString: Event
m_Icon: {fileID: 0}
@@ -863,3 +864,25 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &9060944746453456260
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7059772333487008123}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4098cb6d8f351b44ca98b3bb6311f330, type: 3}
m_Name:
m_EditorClassIdentifier:
animator: {fileID: 9032403516113401987}
controller: {fileID: 0}
textbox: {fileID: 7059772333148747626}
arrow: {fileID: 7395190149993767727}
audioManager: {fileID: 0}
pages: []
emotes:
isOpen: 0
textTest: {fileID: 7059772333487008123}
isTalking: 0