Files
godot-host-test/PrintOrder.cs
T
2026-07-11 10:54:02 +02:00

31 lines
726 B
C#

using Godot;
namespace GodotHostTest;
public partial class PrintOrder : Node
{
[Export] private Node? _otherNode;
public PrintOrder()
{
PrintStatus("constructor");
}
public override void _EnterTree()
{
PrintStatus("_enter_tree");
}
public override void _Ready()
{
PrintStatus("_ready");
}
private void PrintStatus(string moment)
{
var hasExport = _otherNode != null;
var hasParent = GetParent() != null;
var numChildren = GetChildren().Count - 1; // remove the non-script child
GD.Print($"[{moment,11}] Child {Name,-8} Has export? {hasExport} Has parent? {hasParent} Script children? {numChildren}");
}
}