mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
28 lines
667 B
C#
28 lines
667 B
C#
|
|
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}");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|