Hey there,
This is primarily targeted @ArenMook, but also to anyone who can assist me.
I am using the TypeWriterEffect class in order to create custom speech bubbles for my game. I have a function that is built around determining if the TypeWriterEffect "HasFinishedDisplayingText".
public bool HasFinishedDisplayingText() {
bool hasFinishedDisplayingText = true;
if(IsInUse()) {
if(labelTypeWriterEffect != null) {
if(labelTypeWriterEffect.isActive) {
hasFinishedDisplayingText = false;
}
}
}
return hasFinishedDisplayingText;
}
This worked perfectly fine for a few months. However a design constraint occurred where I need to add a URL to the SpeechBubble UILabel text in order to have it drive users to an offer.
Previously when I relied on this function it would correctly determine the state of the TypeWriterText as having finished or not, but now when I use a test string that has a URL or color configured, it persists in being in the mActive state indefinitely. The test string being used is:
[url=http://google.com]Test[/url]
More so what's interesting is that the UILabel itself will populate its text up to a certain point and doesn't seem to proceed past the closing bracket.
What I end up seeing for the UILabel text during game play is:
[url=http://google.com]Test
I've been staring at the TypeWriterEffect code all day and I cannot seem to identify where there miscommunication is occurring. I do not understand why it "breaks" the second I add a URL to it.
My question is this:
- Is there a better way to determine if the TypeWriterEffect has finished?
- Is there a way to rectify the parsing for the TypeWriterEffect so that it will include the terminating [/url] or [-]?
- Is there anything I may be overlooking in this effort?
I appreciate any input as I'm at my wits end and don't see any real alternatives.
Also in order to help provide more clarity, I have attached the TypeWriterEffect script that I'm using.
Best Regards.