AnimationNodeOneShot
Plays an animation once in an AnimationNodeBlendTree.
Plays an animation once in an AnimationNodeBlendTree.
A resource to add to an AnimationNodeBlendTree. This animation node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its request value to AnimationNodeOneShot.OneShotRequest.None.
// Play child animation connected to "shot" port.
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Fire);
// Abort child animation connected to "shot" port.
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Abort);
// Abort child animation with fading out connected to "shot" port.
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.FadeOut);
// Get current state (read-only).
animationTree.Get("parameters/OneShot/active");
// Get current internal state (read-only).
animationTree.Get("parameters/OneShot/internal_active");Optionally, signals can be used by setting an AnimationNodeObserverOneShot through AnimationTree.
var observer = animationTree.Get("parameters/OneShot/observer").As<AnimationNodeObserverOneShot>();
observer.Started += OnOneShotStarted;Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
AnimationNodeOneShotConstructor
public AnimationNodeOneShot();Properties10
AbortOnResetProperty
public bool AbortOnReset { get; set; }If true, the sub-animation will abort if resumed with a reset after a prior interruption.
AutorestartProperty
public bool Autorestart { get; set; }If true, the sub-animation will restart automatically after finishing.
In other words, to start auto restarting, the animation must be played once with the AnimationNodeOneShot.OneShotRequest.Fire request. The AnimationNodeOneShot.OneShotRequest.Abort request stops the auto restarting, but it does not disable the AnimationNodeOneShot.Autorestart itself. So, the AnimationNodeOneShot.OneShotRequest.Fire request will start auto restarting again.
AutorestartDelayProperty
public double AutorestartDelay { get; set; }The delay after which the automatic restart is triggered, in seconds.
AutorestartRandomDelayProperty
public double AutorestartRandomDelay { get; set; }If AnimationNodeOneShot.Autorestart is true, a random additional delay (in seconds) between 0 and this value will be added to AnimationNodeOneShot.AutorestartDelay.
BreakLoopAtEndProperty
public bool BreakLoopAtEnd { get; set; }If true, breaks the loop at the end of the loop cycle for transition, even if the animation is looping.
FadeInCurveProperty
public Curve FadeInCurve { get; set; }Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit Curve.
FadeInTimeProperty
public double FadeInTime { get; set; }The fade-in duration. For example, setting this to 1.0 for a 5 second length animation will produce a cross-fade that starts at 0 second and ends at 1 second during the animation.
Note: AnimationNodeOneShot transitions the current state after the fading has finished.
FadeOutCurveProperty
public Curve FadeOutCurve { get; set; }Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit Curve.
FadeOutTimeProperty
public double FadeOutTime { get; set; }The fade-out duration. For example, setting this to 1.0 for a 5 second length animation will produce a cross-fade that starts at 4 second and ends at 5 second during the animation.
Note: AnimationNodeOneShot transitions the current state after the fading has finished.
MixModeProperty
public AnimationNodeOneShot.MixModeEnum MixMode { get; set; }The blend type.
Methods20
GetAutorestartDelaydouble
public double GetAutorestartDelay();doubleGetAutorestartRandomDelaydouble
public double GetAutorestartRandomDelay();doubleGetFadeInCurveCurve
public Curve GetFadeInCurve();CurveGetFadeInTimedouble
public double GetFadeInTime();doubleGetFadeOutCurveCurve
public Curve GetFadeOutCurve();CurveGetFadeOutTimedouble
public double GetFadeOutTime();doubleGetMixModeAnimationNodeOneShot.MixModeEnum
public AnimationNodeOneShot.MixModeEnum GetMixMode();AnimationNodeOneShot.MixModeEnumHasAutorestartbool
public bool HasAutorestart();boolIsAbortedOnResetbool
public bool IsAbortedOnReset();boolIsLoopBrokenAtEndbool
public bool IsLoopBrokenAtEnd();boolSetAbortOnResetvoid
public void SetAbortOnReset(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetAutorestartvoid
public void SetAutorestart(bool active);| Name | Type | Default |
|---|---|---|
active | bool | — |
SetAutorestartDelayvoid
public void SetAutorestartDelay(double time);| Name | Type | Default |
|---|---|---|
time | double | — |
SetAutorestartRandomDelayvoid
public void SetAutorestartRandomDelay(double time);| Name | Type | Default |
|---|---|---|
time | double | — |
SetBreakLoopAtEndvoid
public void SetBreakLoopAtEnd(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetFadeInCurvevoid
public void SetFadeInCurve(Curve curve);| Name | Type | Default |
|---|---|---|
curve | Curve | — |
SetFadeInTimevoid
public void SetFadeInTime(double time);| Name | Type | Default |
|---|---|---|
time | double | — |
SetFadeOutCurvevoid
public void SetFadeOutCurve(Curve curve);| Name | Type | Default |
|---|---|---|
curve | Curve | — |
SetFadeOutTimevoid
public void SetFadeOutTime(double time);| Name | Type | Default |
|---|---|---|
time | double | — |
SetMixModevoid
public void SetMixMode(AnimationNodeOneShot.MixModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | AnimationNodeOneShot.MixModeEnum | — |
AnimationNodeOneShot.MixModeEnum
| Value | Description |
|---|---|
Add = 1 | Blends two animations additively. See also |
Blend = 0 | Blends two animations. See also |
AnimationNodeOneShot.OneShotRequest
| Value | Description |
|---|---|
Abort = 2 | The request to stop the animation connected to "shot" port. |
FadeOut = 3 | The request to fade out the animation connected to "shot" port. |
Fire = 1 | The request to play the animation connected to "shot" port. |
None = 0 | The default state of the request. Nothing is done. |