Class TweenSettings
Static container for global configuration values that govern the default behaviour of all tweens created through the Scylla Tween system.
Inherited Members
Namespace: Scylla.Core.Util.Tween
Assembly: ScyllaCore.dll
Syntax
public static class TweenSettings
Remarks
Every property in TweenSettings acts as a system-wide default. When a
new tween is constructed (or reset from the pool), it copies these values into its
own fields. Changing a setting after a tween has been created does not
retroactively affect already-live tweens - only tweens created thereafter pick up
the new defaults.
The single exception is GlobalTimeScale, which is applied at update time and therefore takes effect immediately for all managed tweens on the next frame.
The convenience wrapper SetGlobalTimeScale(float), SetDefaultEase(EaseType), SetDefaultDuration(float), and ResetSettings() delegate directly to this class.
Default values:
- GlobalTimeScale =
1.0 - DefaultEaseType = OutQuad
- DefaultDuration =
0.3s - DefaultAutoKill =
true - DefaultPoolCapacity =
64 - DefaultPoolMaxSize =
500
Properties
DefaultAutoKill
Gets or sets whether newly created tweens automatically kill themselves (and return to the pool) immediately after their OnComplete(Action) callback fires.
Declaration
public static bool DefaultAutoKill { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
DefaultDuration
Gets or sets the playback duration in seconds assigned to new tweens when the caller does not pass an explicit duration to the factory method.
Declaration
public static float DefaultDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| float | Must be non-negative. A value of |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when the assigned value is less than |
DefaultEaseType
Gets or sets the easing curve assigned to new tweens when no explicit ease is provided via SetEase(EaseType).
Declaration
public static EaseType DefaultEaseType { get; set; }
Property Value
| Type | Description |
|---|---|
| EaseType | Any value of EaseType is accepted, including
Custom (though Custom without a
delegate registered via |
DefaultPoolCapacity
Gets or sets the initial pre-allocation capacity for each typed tween pool
(e.g. the TweenFloat pool, the TweenVector3 pool, etc.).
Declaration
public static int DefaultPoolCapacity { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Must be at least |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when the assigned value is less than |
DefaultPoolMaxSize
Gets or sets the upper bound on the number of tween instances each typed pool will retain when tweens are returned to it.
Declaration
public static int DefaultPoolMaxSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Must be at least |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when the assigned value is less than |
GlobalTimeScale
Gets or sets the global time scale multiplier applied to every managed tween during the Update(float) call.
Declaration
public static float GlobalTimeScale { get; set; }
Property Value
| Type | Description |
|---|---|
| float | A non-negative multiplier. The effective delta time for a managed tween each frame
is |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when the assigned value is less than |
Methods
ResetToDefaults()
Restores all settings to their original built-in default values.
Declaration
public static void ResetToDefaults()
Remarks
Resets:
- GlobalTimeScale ->
1.0 - DefaultEaseType -> OutQuad
- DefaultDuration ->
0.3s - DefaultAutoKill ->
true - DefaultPoolCapacity ->
64 - DefaultPoolMaxSize ->
500
This method is exposed via ResetSettings() for convenience. It does not affect tweens that are already live or pools that have already been initialized.