hurrmmm/godot/TAS_system/TASable.cs

34 lines
974 B
C#

using Godot;
using System;
using System.Globalization;
public partial class TASable : Node
{
Node3D _parent;
public override void _Ready()
{
this._parent = this.GetParent<Node3D>();
TAS_System TAS = GetNode<TAS_System>("/root/TAS_System");
TAS.FrameIncremented += this.OnFrameIncremented;
TAS.FramesAdvanced += this.OnFramesAdvanced;
TAS.FramesRegressed += this.OnFramesRegressed;
}
public virtual void OnFrameIncremented(int newFrame)
{
GD.Print($"Frame advanced to {newFrame}, called from node {_parent.Name}");
}
public virtual void OnFramesAdvanced(int startFrame, int endFrame)
{
GD.Print($"Frames advanced from {startFrame} to {endFrame}, called from node {_parent.Name}");
}
public virtual void OnFramesRegressed(int startFrame, int endFrame)
{
GD.Print($"Frames regressed from {startFrame} to {endFrame}, called from node {_parent.Name}");
}
}