public partial class Foo : Node
{
private readonly Subject<Unit> _s = new();
public override void _Ready()
{
_s.AddTo(this);
}
}
Disposable will be disposed when node has been exited tree.
If this method is called before enter tree, there is no guarantee that it will be dispiosed, so a warning log is displayed if it is called on a constructor or the like.
Add AddTo extension method for Godot.Node class.
Disposable will be disposed when node has been exited tree.
If this method is called before enter tree, there is no guarantee that it will be dispiosed, so a warning log is displayed if it is called on a constructor or the like.