Automatic doors

This commit is contained in:
Marco 2025-04-23 13:38:54 +02:00
commit 3fc39f63c4
29 changed files with 401 additions and 525 deletions

View file

@ -0,0 +1,28 @@
using System.Linq;
using Godot;
namespace Cirno.Scripts.Controllers;
[Tool]
public partial class RogueliteDoorContainer : Node2D
{
[ExportToolButton("Arrange Doors")] public Callable ArrangeDoorsButton => Callable.From(ArrangeDoors);
public void ArrangeDoors()
{
var doors = this.GetChildren();
foreach (var node in doors)
{
if (node is DoorMarker doorMarker)
{
GD.Print($"{doorMarker.Name} {doorMarker.Direction} {doorMarker.WallIndex}");
}
else
{
GD.Print($"Node was something else: {node}");
}
}
}
}