Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class CameraLimiter : MonoBehaviour | ||
{ | ||
|
||
public Vector4 bounds; | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
if(transform.position.y>bounds.x) | ||
{ | ||
transform.position = new Vector3(transform.position.x, bounds.x, transform.position.z); | ||
}else if(transform.position.y < bounds.z) | ||
{ | ||
transform.position = new Vector3(transform.position.x, bounds.z, transform.position.z); | ||
} | ||
|
||
if (transform.position.x > bounds.y) | ||
{ | ||
transform.position = new Vector3( bounds.y, transform.position.y, transform.position.z); | ||
} | ||
else if (transform.position.x < bounds.w) | ||
{ | ||
transform.position = new Vector3(bounds.w, transform.position.y, transform.position.z); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
[CreateAssetMenu(fileName = "Objects", menuName = "Amaz/Dialog", order = 1)] | ||
public class Dialog : ScriptableObject | ||
{ | ||
public string name; | ||
public Sprite sprite; | ||
[TextArea(2,6)] | ||
public string[] sentences; | ||
|
||
public Dialog next; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class DialogManager : MonoBehaviour | ||
{ | ||
|
||
public GameObject dialogue; | ||
|
||
public Text dialogtxt; | ||
public Text dialogname; | ||
public Image dialogimg; | ||
|
||
public static DialogManager instance; | ||
|
||
public Queue<string> sentences; | ||
|
||
public Dialog curDial; | ||
|
||
public float typingSpeed=0.02f; | ||
|
||
Coroutine corout = null; | ||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
sentences = new Queue<string>(); | ||
LoadDialogues(curDial); | ||
} | ||
|
||
public void EndDialogue() | ||
{ | ||
dialogue.SetActive(false); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if(Input.GetKeyDown(KeyCode.Space)) | ||
{ | ||
if(sentences.Count==0) | ||
{ | ||
if(curDial.next!=null) | ||
{ | ||
LoadDialogues(curDial.next); | ||
}else | ||
{ | ||
EndDialogue(); | ||
} | ||
|
||
}else | ||
{ | ||
string sente= sentences.Dequeue(); | ||
|
||
if (corout != null) | ||
{ | ||
StopCoroutine(corout); | ||
} | ||
corout = StartCoroutine(Type(sente)); | ||
} | ||
|
||
|
||
} | ||
} | ||
|
||
// Update is called once per frame | ||
void LoadDialogues(Dialog dial) | ||
{ | ||
curDial = dial; | ||
sentences.Clear(); | ||
|
||
foreach (string sentence in dial.sentences) | ||
{ | ||
sentences.Enqueue(sentence); | ||
} | ||
dialogue.SetActive(true); | ||
dialogname.text = dial.name; | ||
dialogimg.sprite = dial.sprite; | ||
if(corout!=null) | ||
{ | ||
StopCoroutine(corout); | ||
} | ||
|
||
corout = StartCoroutine(Type(sentences.Dequeue())); | ||
} | ||
|
||
|
||
|
||
IEnumerator Type(string sent) | ||
{ | ||
dialogtxt.text = ""; | ||
|
||
foreach (char c in sent.ToCharArray()) | ||
{ | ||
dialogtxt.text += c; | ||
yield return new WaitForSeconds(typingSpeed); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d3a679e32d9d99e4a9fff3c9c9bfc5d9, type: 3} | ||
m_Name: Bernie1 | ||
m_EditorClassIdentifier: | ||
name: Lernie Banders | ||
sprite: {fileID: 21300000, guid: 8c6fe8be61dfec3429f76a58a74fd810, type: 3} | ||
sentences: | ||
- "Mr.. Mr Busk?\tAre you there?" | ||
- 'Something terrible has happened. Our great country ZIMBURICA is in danger. | ||
' | ||
- I am once again asking for your genius mr Busk | ||
- Could u help a brother out? | ||
next: {fileID: 11400000, guid: 88d7c2da16498814796074a66ac2349d, type: 2} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d3a679e32d9d99e4a9fff3c9c9bfc5d9, type: 3} | ||
m_Name: Bernie2 | ||
m_EditorClassIdentifier: | ||
name: Lernie Banders | ||
sprite: {fileID: 21300000, guid: 8c6fe8be61dfec3429f76a58a74fd810, type: 3} | ||
sentences: | ||
- It's is the economy! It be crashing real hard. Because of the big rona lirus. | ||
This sh*t is dangerous! | ||
- 'Anyways the economy, we need you to... | ||
KEEP IT ALIVE' | ||
- The Federal Reserve can't print enough money! And i though u could help cuz i | ||
heard.. | ||
- I heard you can make money printers go brrrrrr better than anyone else | ||
- I heard you can make money printers go brrrrrr better than anyone else | ||
next: {fileID: 11400000, guid: 6d9b348cc7e9f4844834200cd183893a, type: 2} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d3a679e32d9d99e4a9fff3c9c9bfc5d9, type: 3} | ||
m_Name: Bernie3 | ||
m_EditorClassIdentifier: | ||
name: Lernie Banders | ||
sprite: {fileID: 21300000, guid: 8c6fe8be61dfec3429f76a58a74fd810, type: 3} | ||
sentences: | ||
- Ah yiiiiis, i am glad you are in mr Elon Musk, (*cough*) Fellon Busk I mean. | ||
- Don't worry about that right, the ZIMBURICA people need you. | ||
- We have made this space you see available for you to start making printers go | ||
brrrrr. | ||
- 'TTYL8R and Good Luck Felon-San <3! ' | ||
next: {fileID: 11400000, guid: 7e61fefa1a3f5824c80d63fbdbc654ae, type: 2} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d3a679e32d9d99e4a9fff3c9c9bfc5d9, type: 3} | ||
m_Name: Elon1 | ||
m_EditorClassIdentifier: | ||
name: Felon Busk | ||
sprite: {fileID: 21300000, guid: 202948ae848bd9a4bac0124735fea300, type: 3} | ||
sentences: | ||
- haha u did the meme. | ||
- What is happening? why are we in danger, arent ya overreacting you Boomer? | ||
next: {fileID: 11400000, guid: 86696d80981763947981526c91df7cf2, type: 2} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d3a679e32d9d99e4a9fff3c9c9bfc5d9, type: 3} | ||
m_Name: Elon2 | ||
m_EditorClassIdentifier: | ||
name: Felon Busk | ||
sprite: {fileID: 21300000, guid: 202948ae848bd9a4bac0124735fea300, type: 3} | ||
sentences: | ||
- Oooof my man I've made rockets, electric cars, solar panels, but money? That something | ||
new. | ||
- "Heck! \nLemme give a try," | ||
- But, what about hyperinflation? I don't what to happen here the same that happened | ||
with the great nation of Zimbabwe. | ||
next: {fileID: 11400000, guid: 6d528c8e782cb834982175500e6202d7, type: 2} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d3a679e32d9d99e4a9fff3c9c9bfc5d9, type: 3} | ||
m_Name: Elon3 | ||
m_EditorClassIdentifier: | ||
name: Felon Busk | ||
sprite: {fileID: 21300000, guid: 202948ae848bd9a4bac0124735fea300, type: 3} | ||
sentences: | ||
- Aight lets ged to work! | ||
next: {fileID: 11400000, guid: bc309e802e11e8f4d975df0b16cc6322, type: 2} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.