Skip to content

Commit

Permalink
Format TextTagParser and TextTyperTester
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardrowe committed Apr 4, 2019
1 parent 0559905 commit 67c6f91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Assets/RedBlueGames/TextTyper/Examples/TextTyperTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class TextTyperTester : MonoBehaviour

public void Start()
{
this.testTextTyper.PrintCompleted.AddListener(this.HandlePrintCompleted);
this.testTextTyper.PrintCompleted.AddListener(this.HandlePrintCompleted);
this.testTextTyper.CharacterPrinted.AddListener(this.HandleCharacterPrinted);

this.printNextButton.onClick.AddListener(this.HandlePrintNextClicked);
Expand All @@ -43,14 +43,14 @@ public void Start()
dialogueLines.Enqueue("You can <size=40>size 40</size> and <size=20>size 20</size>");
dialogueLines.Enqueue("You can <color=#ff0000ff>color</color> tag <color=#00ff00ff>like this</color>.");
dialogueLines.Enqueue("Sample Shake Animations: <anim=lightrot>Light Rotation</anim>, <anim=lightpos>Light Position</anim>, <anim=fullshake>Full Shake</anim>\nSample Curve Animations: <animation=slowsine>Slow Sine</animation>, <animation=bounce>Bounce Bounce</animation>, <animation=crazyflip>Crazy Flip</animation>");
ShowScript( );
ShowScript();
}

public void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{

var tag = RichTextTag.ParseNext("blah<color=red>boo</color");
LogTag(tag);
tag = RichTextTag.ParseNext("<color=blue>blue</color");
Expand Down
10 changes: 5 additions & 5 deletions Assets/RedBlueGames/TextTyper/TextTagParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ public sealed class TextTagParser
/// <summary>
/// Define custom tags here. These should also be added to the CustomTagTypes List below
/// </summary>
public struct CustomTags
public struct CustomTags
{
public const string Delay = "delay";
public const string Anim = "anim";
public const string Animation = "animation";
}

private static readonly List<string> UnityTagTypes = new List<string> { "b", "i", "size", "color" };
private static readonly List<string> CustomTagTypes = new List<string>
private static readonly List<string> CustomTagTypes = new List<string>
{
CustomTags.Delay,
CustomTags.Anim,
CustomTags.Animation,
};

public static List<TextSymbol> CreateSymbolListFromText(string text)
{
var symbolList = new List<TextSymbol>();
Expand Down Expand Up @@ -133,7 +133,7 @@ public bool IsTag
}
}

public float GetFloatParameter(float defaultValue = 0f)
public float GetFloatParameter(float defaultValue = 0f)
{
if (!this.IsTag)
{
Expand All @@ -148,7 +148,7 @@ public float GetFloatParameter(float defaultValue = 0f)
"Found Invalid parameter format in tag [{0}]. " +
"Parameter [{1}] does not parse to a float.",
this.Tag,
this.Tag.Parameter );
this.Tag.Parameter);
Debug.LogWarning(warning);
paramValue = defaultValue;
}
Expand Down

0 comments on commit 67c6f91

Please sign in to comment.