-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
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.
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.
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.
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.
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,30 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Dialog : MonoBehaviour | ||
{ | ||
public List<string> speeches; | ||
|
||
// Use this for initialization | ||
void Start() | ||
{ | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
} | ||
|
||
public IEnumerator talk() | ||
{ | ||
foreach(string s in speeches) | ||
{ | ||
GameObject g = new GameObject(); | ||
g.transform.parent = this.gameObject.transform; | ||
DialogBox d = new DialogBox(); | ||
|
||
yield return new WaitForSeconds(2.0f); | ||
} | ||
} | ||
} |
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,34 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class DialogBox : MonoBehaviour | ||
{ | ||
private Text textbox; | ||
|
||
// Use this for initialization | ||
void Start() | ||
{ | ||
textbox = GetComponent<Text>(); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
|
||
} | ||
|
||
public IEnumerator Speak(string text) | ||
{ | ||
int i = 0; | ||
textbox.text = ""; | ||
|
||
while(i < text.Length) | ||
{ | ||
textbox.text += text[i]; | ||
++i; | ||
yield return new WaitForSeconds(.5f); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.