Class AnimationNodeExtension
- Namespace
- Godot
- Assembly
- GodotSharp.dll
AnimationNodeExtension exposes the APIs of AnimationRootNode to allow users to extend it from GDScript, C#, or C++. This class is not meant to be used directly, but to be extended by other classes. It is used to create custom nodes for the AnimationTree system.
public class AnimationNodeExtension : AnimationNode, IDisposable
- Inheritance
-
AnimationNodeExtension
- Implements
- Inherited Members
Constructors
AnimationNodeExtension()
public AnimationNodeExtension()
Methods
GetRemainingTime(ReadOnlySpan<float>, bool)
Returns the animation's remaining time for the given node info. For looping animations, it will only return the remaining time if breakLoop
is true, a large integer value will be returned otherwise.
public static double GetRemainingTime(ReadOnlySpan<float> nodeInfo, bool breakLoop)
Parameters
nodeInfo
ReadOnlySpan<float>breakLoop
bool
Returns
GetRemainingTime(float[], bool)
Returns the animation's remaining time for the given node info. For looping animations, it will only return the remaining time if breakLoop
is true, a large integer value will be returned otherwise.
public static double GetRemainingTime(float[] nodeInfo, bool breakLoop)
Parameters
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
IsLooping(ReadOnlySpan<float>)
Returns true if the animation for the given nodeInfo
is looping.
public static bool IsLooping(ReadOnlySpan<float> nodeInfo)
Parameters
nodeInfo
ReadOnlySpan<float>
Returns
IsLooping(float[])
Returns true if the animation for the given nodeInfo
is looping.
public static bool IsLooping(float[] nodeInfo)
Parameters
nodeInfo
float[]
Returns
_ProcessAnimationNode(double[], bool)
A version of the _Process(double, bool, bool, bool) method that is meant to be overridden by custom nodes. It returns a float[] with the processed animation data.
The double[] parameter contains the playback information, containing the following values encoded as floating point numbers (in order): playback time and delta, start and end times, whether a seek was requested (encoded as a float greater than 0
), whether the seek request was externally requested (encoded as a float greater than 0
), the current Animation.LoopedFlag (encoded as a float), and the current blend weight.
The function must return a float[] of the node's time info, containing the following values (in order): animation length, time position, delta, Animation.LoopModeEnum (encoded as a float), whether the animation is about to end (encoded as a float greater than 0
) and whether the animation is infinite (encoded as a float greater than 0
). All values must be included in the returned array.
public virtual float[] _ProcessAnimationNode(double[] playbackInfo, bool testOnly)
Parameters
Returns
- float[]