diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-08-24 00:14:06 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-08-24 00:14:06 -0400 |
| commit | 581eb102d540bc495ec62dae25fcea0d676d1a59 (patch) | |
| tree | 898078c2580819b953ad7696779269827667e853 /Assets/Scripts | |
| parent | 4c192cebf7af6c271b8a8a9b10616c85ab2856dd (diff) | |
| download | Project-Sandbox-581eb102d540bc495ec62dae25fcea0d676d1a59.tar.gz Project-Sandbox-581eb102d540bc495ec62dae25fcea0d676d1a59.tar.bz2 Project-Sandbox-581eb102d540bc495ec62dae25fcea0d676d1a59.zip | |
Dialogue; Unlock cursor
Diffstat (limited to 'Assets/Scripts')
| -rw-r--r-- | Assets/Scripts/Dialogue.meta | 8 | ||||
| -rw-r--r-- | Assets/Scripts/Dialogue/Dialogue.cs | 12 | ||||
| -rw-r--r-- | Assets/Scripts/Dialogue/Dialogue.cs.meta | 11 | ||||
| -rw-r--r-- | Assets/Scripts/Dialogue/DialogueManager.cs | 21 | ||||
| -rw-r--r-- | Assets/Scripts/Dialogue/DialogueManager.cs.meta | 11 | ||||
| -rw-r--r-- | Assets/Scripts/Dialogue/DialogueTrigger.cs | 13 | ||||
| -rw-r--r-- | Assets/Scripts/Dialogue/DialogueTrigger.cs.meta | 11 | ||||
| -rw-r--r-- | Assets/Scripts/UnlockCursor.cs | 22 | ||||
| -rw-r--r-- | Assets/Scripts/UnlockCursor.cs.meta | 11 |
9 files changed, 120 insertions, 0 deletions
diff --git a/Assets/Scripts/Dialogue.meta b/Assets/Scripts/Dialogue.meta new file mode 100644 index 0000000..9916df6 --- /dev/null +++ b/Assets/Scripts/Dialogue.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5fcc17da87c829e7dae5e6566ac60ae2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dialogue/Dialogue.cs b/Assets/Scripts/Dialogue/Dialogue.cs new file mode 100644 index 0000000..bf2c960 --- /dev/null +++ b/Assets/Scripts/Dialogue/Dialogue.cs @@ -0,0 +1,12 @@ +using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+[System.Serializable]
+public class Dialogue
+{
+ public string name;
+
+ [TextArea(3, 10)]
+ public string[] sentences;
+}
diff --git a/Assets/Scripts/Dialogue/Dialogue.cs.meta b/Assets/Scripts/Dialogue/Dialogue.cs.meta new file mode 100644 index 0000000..06fe34a --- /dev/null +++ b/Assets/Scripts/Dialogue/Dialogue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c51f13272531bf313b4525ab297ca9b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dialogue/DialogueManager.cs b/Assets/Scripts/Dialogue/DialogueManager.cs new file mode 100644 index 0000000..056e7d9 --- /dev/null +++ b/Assets/Scripts/Dialogue/DialogueManager.cs @@ -0,0 +1,21 @@ +using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DialogueManager : MonoBehaviour
+{
+
+ private Queue<string> sentences;
+
+ // Start is called before the first frame update
+ void Start()
+ {
+ sentences = new Queue<string>();
+ }
+
+ public void StartDialogue(Dialogue dialogue)
+ {
+ Debug.Log("Starting conversation with " + dialogue.name);
+ }
+
+}
diff --git a/Assets/Scripts/Dialogue/DialogueManager.cs.meta b/Assets/Scripts/Dialogue/DialogueManager.cs.meta new file mode 100644 index 0000000..c4089d4 --- /dev/null +++ b/Assets/Scripts/Dialogue/DialogueManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c8e9050d46a64b3a833517e2db4a78b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Dialogue/DialogueTrigger.cs b/Assets/Scripts/Dialogue/DialogueTrigger.cs new file mode 100644 index 0000000..3ca0ae1 --- /dev/null +++ b/Assets/Scripts/Dialogue/DialogueTrigger.cs @@ -0,0 +1,13 @@ +using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DialogueTrigger : MonoBehaviour
+{
+ public Dialogue dialogue;
+
+ public void TriggerDialogue()
+ {
+ FindObjectOfType<DialogueManager>().StartDialogue(dialogue);
+ }
+}
diff --git a/Assets/Scripts/Dialogue/DialogueTrigger.cs.meta b/Assets/Scripts/Dialogue/DialogueTrigger.cs.meta new file mode 100644 index 0000000..3d54ac1 --- /dev/null +++ b/Assets/Scripts/Dialogue/DialogueTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5575ce16db5683b796e3a9db6a8a0e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UnlockCursor.cs b/Assets/Scripts/UnlockCursor.cs new file mode 100644 index 0000000..3f3812c --- /dev/null +++ b/Assets/Scripts/UnlockCursor.cs @@ -0,0 +1,22 @@ +using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UnlockCursor : MonoBehaviour
+{
+ public bool lockCursor = true;
+ // Update is called once per frame
+ void Update()
+ {
+ if (Input.GetKeyDown(KeyCode.F1))
+ {
+ lockCursor = !lockCursor;
+ }
+
+ Cursor.lockState = lockCursor ? CursorLockMode.Locked : CursorLockMode.None;
+ Cursor.visible = !lockCursor;
+
+ }
+
+}
diff --git a/Assets/Scripts/UnlockCursor.cs.meta b/Assets/Scripts/UnlockCursor.cs.meta new file mode 100644 index 0000000..45cf829 --- /dev/null +++ b/Assets/Scripts/UnlockCursor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d447635ba689deb97b1b5141635f8738 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |
