31 lines
478 B
C#
31 lines
478 B
C#
using Godot;
|
|
using GodotUtilities;
|
|
|
|
namespace NodeWar;
|
|
|
|
[Scene]
|
|
public partial class Root : Node2D
|
|
{
|
|
[Node]
|
|
private Line2D line2D;
|
|
|
|
public override void _Ready()
|
|
{
|
|
GD.Print(line2D);
|
|
}
|
|
|
|
public void ConnectNodules(Nodule a, Nodule b)
|
|
{
|
|
GlobalPosition = a.GlobalPosition;
|
|
line2D.Points = [Vector2.Zero, b.GlobalPosition - a.GlobalPosition];
|
|
}
|
|
|
|
public override void _Notification(int what)
|
|
{
|
|
if (what == NotificationSceneInstantiated)
|
|
{
|
|
WireNodes();
|
|
}
|
|
}
|
|
}
|