Added Timer
New version featuring a timer
This commit is contained in:
parent
f7c4067db4
commit
750d7f6b88
14 changed files with 186 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "New Character", menuName = "Tools/Character", order = 0)]
|
||||
[CreateAssetMenu(fileName = "New Character", menuName = "Simple Tools/Character", order = 11)]
|
||||
public class Dialogue : ScriptableObject{
|
||||
|
||||
public bool displayName;
|
||||
|
|
|
@ -8,12 +8,17 @@ namespace TMPro{
|
|||
|
||||
public class TMP_Animated : TextMeshProUGUI{
|
||||
|
||||
float speed;
|
||||
float speed = 20;
|
||||
|
||||
public TextRevealEvent onTextReveal;
|
||||
public DialogueEvent onDialogueFinish;
|
||||
|
||||
public void ReadText(string newText){
|
||||
void Update(){
|
||||
/*if(Application.isPlaying)
|
||||
this.Animate();*/
|
||||
}
|
||||
|
||||
public void ReadText(string newText){
|
||||
text = string.Empty;
|
||||
|
||||
string[] subTexts = newText.Split('<', '>');
|
||||
|
@ -27,7 +32,7 @@ namespace TMPro{
|
|||
}
|
||||
|
||||
bool isCustomTag(string tag){
|
||||
return tag.StartsWith("speed=") || tag.StartsWith("pause=");
|
||||
return tag.StartsWith("speed=") || tag.StartsWith("pause=") || tag.StartsWith("wave") || tag.StartsWith("rainbow") || tag.StartsWith("shake");
|
||||
}
|
||||
|
||||
text = displayText;
|
||||
|
@ -45,7 +50,9 @@ namespace TMPro{
|
|||
onTextReveal.Invoke(subTexts[subCounter][visibleCounter]);
|
||||
visibleCounter++;
|
||||
maxVisibleCharacters++;
|
||||
yield return new WaitForSeconds(1f / speed);
|
||||
//this.Animate();
|
||||
|
||||
yield return new WaitForSeconds(text[maxVisibleCharacters - 1] == ' ' ? 0 : (1f / speed));
|
||||
}
|
||||
visibleCounter = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue