Class TextEffectPreset
An authored set of effect settings, saved as an asset so it can be tuned in the Inspector and reused wherever the same look is wanted.
Inheritance
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public abstract class TextEffectPreset : ScriptableObject
Remarks
A preset carries settings, not a running effect. Ask it for an effect and it hands back a fresh one configured from its fields, so the same asset can drive any number of effects at once without them interfering.
view.Effects.Play(preset.CreateEffect().SetRegion(panel));
Regions are deliberately not part of a preset. Where an effect plays is a decision the calling code makes from what is on screen, not something that travels with a look.
Fields
_cellDuration
How much of the run each individual cell takes.
Declaration
[Tooltip("How much of the run each individual cell takes, from just above 0 to 1. At 1 the region animates as one and the ordering is invisible. Lower values spread the cells out along the ordering.")]
[SerializeField]
[Range(0.001, 1)]
protected float _cellDuration
Field Value
| Type | Description |
|---|---|
| float |
_delay
How long the effect waits before it begins.
Declaration
[Tooltip("How long the effect waits before it begins advancing. It writes nothing while it waits.")]
[SerializeField]
[Min(0)]
protected float _delay
Field Value
| Type | Description |
|---|---|
| float |
_duration
How long the effect runs for, in seconds.
Declaration
[Header("Timing")]
[Tooltip("How long the effect runs for, in seconds. Some effects work out their own duration instead, such as a typewriter deriving it from its typing speed.")]
[SerializeField]
[Range(0, 600)]
protected float _duration
Field Value
| Type | Description |
|---|---|
| float |
_ease
Easing curve applied to the effect's progress.
Declaration
[Tooltip("The easing curve applied to the effect's progress. Easing out is what stops an effect ending abruptly, by spreading its last few cells over a longer stretch of the run.")]
[SerializeField]
protected EaseType _ease
Field Value
| Type | Description |
|---|---|
| EaseType |
_maskBands
Band count or block size, for the patterns that use one.
Declaration
[Tooltip("Band count for blinds, or block size for a checkerboard. A band needs a few cells of depth to open smoothly, so asking for more bands than the region can carry gives fewer and deeper ones.")]
[SerializeField]
[Min(1)]
protected int _maskBands
Field Value
| Type | Description |
|---|---|
| int |
_maskDirection
Direction of travel, for the patterns that have one.
Declaration
[Tooltip("The direction the pattern travels, for the patterns that have one.")]
[SerializeField]
protected TextEffectDirection _maskDirection
Field Value
| Type | Description |
|---|---|
| TextEffectDirection |
_maskInverted
Whether the pattern runs the other way.
Declaration
[Tooltip("Reverses the pattern: an iris closes instead of opening, a clock runs the other way, barn doors shut instead of parting.")]
[SerializeField]
protected bool _maskInverted
Field Value
| Type | Description |
|---|---|
| bool |
_maskPattern
Ordering applied across the region, for effects that stagger their cells.
Declaration
[Tooltip("The order the effect reaches cells in. Only meaningful for effects that treat their cells separately, which is most of them.")]
[SerializeField]
protected TextEffectMaskPattern _maskPattern
Field Value
| Type | Description |
|---|---|
| TextEffectMaskPattern |
_overrideMask
Whether the ordering below replaces whatever the effect would have chosen for itself.
Declaration
[Header("Ordering")]
[Tooltip("Replaces the ordering the effect picks for itself. Leave this off unless you want to choose the order: some effects default to a non-uniform one because their look depends on it, a cross fade to a dissolve and a static tune in to a noise field, and turning this on overrides that. Effects that ignore ordering entirely will warn that the mask does nothing.")]
[SerializeField]
protected bool _overrideMask
Field Value
| Type | Description |
|---|---|
| bool |
_speed
Playback speed multiplier applied on top of the duration.
Declaration
[Tooltip("A speed multiplier applied on top of the duration. A value of 2 plays the effect twice as fast.")]
[SerializeField]
[Range(0.01, 100)]
protected float _speed
Field Value
| Type | Description |
|---|---|
| float |
_timeMode
Which clock the effect advances on.
Declaration
[Tooltip("Whether the effect honors framework pause and time scale. Console and menu effects usually should not, so that they keep running while the game is paused.")]
[SerializeField]
protected TextEffectTimeMode _timeMode
Field Value
| Type | Description |
|---|---|
| TextEffectTimeMode |
Methods
ApplyShared<T>(T)
Copies the settings every effect shares onto a newly created one.
Declaration
protected T ApplyShared<T>(T effect) where T : TextEffectBase
Parameters
| Type | Name | Description |
|---|---|---|
| T | effect | The effect to configure. |
Returns
| Type | Description |
|---|---|
| T | The effect, so a subclass can go on configuring it. |
Type Parameters
| Name | Description |
|---|---|
| T | The concrete effect type. |
BuildMask()
Builds the ordering described by this preset's mask fields.
Declaration
protected CellMask BuildMask()
Returns
| Type | Description |
|---|---|
| CellMask | The configured mask. |
CreateEffect()
Creates a fresh effect configured from this preset.
Declaration
public abstract TextEffectBase CreateEffect()
Returns
| Type | Description |
|---|---|
| TextEffectBase | An unstarted effect. |