mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 23:05:54 +00:00
Automatic doors
This commit is contained in:
parent
c3107fbce9
commit
3fc39f63c4
29 changed files with 401 additions and 525 deletions
28
Scripts/Controllers/RogueliteDoorContainer.cs
Normal file
28
Scripts/Controllers/RogueliteDoorContainer.cs
Normal 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}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue