Finished Textbox interaction

changed movement to pause it
This commit is contained in:
Rizvee
2022-02-23 20:09:45 -06:00
parent 3a81f1a122
commit 6a18528098
5 changed files with 77 additions and 38 deletions
+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
+36 -19
View File
@@ -1384,6 +1384,14 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4883996976931216989, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: -8109058881888065430, guid: f99a1e623eb554e4aa4314aba18b2531, type: 3}
- target: {fileID: 4883996976931216989, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_WasSpriteAssigned
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7059772333487008123, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_Name
value: testbox
@@ -1436,23 +1444,28 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7479122399646608139, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_Camera
value:
objectReference: {fileID: 374095577}
- target: {fileID: 8637085924552831791, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_LocalScale.x
value: 72
objectReference: {fileID: 0}
- target: {fileID: 8637085924552831791, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_LocalScale.y
value: 72
objectReference: {fileID: 0}
- target: {fileID: 8637085924552831791, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_AnchoredPosition.x
value: -720
objectReference: {fileID: 0}
- target: {fileID: 8637085924552831791, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
propertyPath: m_AnchoredPosition.y
value: -353
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
--- !u!95 &1330887280 stripped
Animator:
m_CorrespondingSourceObject: {fileID: 9032403516113401987, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
m_PrefabInstance: {fileID: 1330887279}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1330887281 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6300146333193859577, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
m_PrefabInstance: {fileID: 1330887279}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1330887282 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7059772332581294260, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
m_PrefabInstance: {fileID: 1330887279}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1477138877
GameObject:
m_ObjectHideFlags: 0
@@ -1607,6 +1620,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ff8c6d62e5fc0f6478840a18add47f3a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1683218372 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7059772333487008123, guid: 6ea336e93a8128346aad568255a7e6af, type: 3}
m_PrefabInstance: {fileID: 1330887279}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1862206375
GameObject:
m_ObjectHideFlags: 0
@@ -1730,15 +1748,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
forceInteract: 0
repeatable: 1
repeatable: 0
value: 0
TextBox: {fileID: 1330887282}
HeadBox: {fileID: 1330887281}
TextBox: {fileID: 1683218372}
pages:
- asdfsadfasfdsadfasdfsdfasdfasdf
- ahhhhhhhhhhhhhhh
emotes: 0100000003000000
controller: {fileID: 1330887280}
controller: {fileID: 9100000, guid: 7eb4fdbc838e84a8e83347d54fd48aa6, type: 2}
startSprite: {fileID: -8109058881888065430, guid: f99a1e623eb554e4aa4314aba18b2531, type: 3}
audioManager: {fileID: 1586724389}
isTalking: 1