Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Method in Effects
A coroutine that gradually reveals the text in a TextMeshProUGUI
object over time.
This method works by adjusting the value of the text
parameter's TextMeshProUGUI.maxVisibleCharacters
property. This means that word wrapping will not change half-way through the presentation of a word.
Depending on the value of lettersPerSecond
, onCharacterTyped
may be called multiple times per frame.
Due to an internal implementation detail of TextMeshProUGUI, this method will always take at least one frame to execute, regardless of the length of the text
parameter's text.
Name | Description |
---|---|
TextMeshProUGUI
text
A TextMeshProUGUI object to reveal the text of.
float
lettersPerSecond
The number of letters that should be revealed per second.
Action
onCharacterTyped
An Action
that should be called for each character that was revealed.
A CoroutineInterruptToken that can be used to interrupt the coroutine.
Method in Effects
A coroutine that fades a CanvasGroup
object's opacity from from
to to
over the course of fadeTime
seconds, and then invokes onComplete
.
Name | Description |
---|---|
Class in Effects
Inherits from System.Object
An object that can be used to signal to a coroutine that it should terminate early.
While coroutines can be stopped by calling MonoBehaviour.StopCoroutine
or MonoBehaviour.StopAllCoroutines
, this has the side effect of also stopping any coroutine that was waiting for the now-stopped coroutine to finish.
Instances of this class may be passed as a parameter to a coroutine that they can periodically poll to see if they should terminate earlier than planned.
To use this class, create an instance of it, and pass it as a parameter to your coroutine. In the coroutine, call Start() to mark that the coroutine is running. During the coroutine's execution, periodically check the WasInterrupted property to determine if the coroutine should exit. If it is true
, the coroutine should exit (via the yield break
statement.) At the normal exit of your coroutine, call the Complete() method to mark that the coroutine is no longer running. To make a coroutine stop, call the Interrupt() method.
You can also use the CanInterrupt property to determine if the token is in a state in which it can stop (that is, a coroutine that's using it is currently running.)
Name | Description |
---|---|
Name | Description |
---|---|
float
from
The opacity value to start fading from, ranging from 0 to 1.
float
to
The opacity value to end fading at, ranging from 0 to 1.
A CoroutineInterruptToken that can be used to interrupt the coroutine.
CanvasGroup
canvasGroup
float
fadeTime
Class in Yarn.Unity
Inherits from System.Object
Contains coroutine methods that apply visual effects. This class is used by LineView to handle animating the presentation of lines.
Name | Description |
---|---|
Name | Description |
---|---|
An object that can be used to signal to a coroutine that it should terminate early.
A coroutine that fades a CanvasGroup
object's opacity from from
to to
over the course of fadeTime
seconds, and then invokes onComplete
.
A coroutine that gradually reveals the text in a TextMeshProUGUI
object over time.