mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:45:33 +00:00
31 lines
963 B
C#
31 lines
963 B
C#
using Cirno.Scripts.Enums;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Controllers;
|
|
|
|
[Tool]
|
|
public partial class DoorMarker : Marker2D
|
|
{
|
|
[Export] public DoorDirections Direction { get; set; } = DoorDirections.North;
|
|
[Export] public int WallIndex { get; set; } = 0; // Useful if there are multiple along a wall
|
|
|
|
public Vector2I GetWorldDirection()
|
|
{
|
|
return Direction switch
|
|
{
|
|
DoorDirections.North => new Vector2I(0, -1),
|
|
DoorDirections.South => new Vector2I(0, 1),
|
|
DoorDirections.East => new Vector2I(1, 0),
|
|
DoorDirections.West => new Vector2I(-1, 0),
|
|
_ => Vector2I.Zero
|
|
};
|
|
}
|
|
|
|
// public override void _Draw()
|
|
// {
|
|
// if (!Engine.IsEditorHint()) return;
|
|
//
|
|
// DrawLine(Vector2.Zero, Vector2.Up * 16, Colors.Orange, 2);
|
|
// DrawString(GetFont("font", "Label"), new Vector2(10, -10), Direction.ToString(), HAlign.Left);
|
|
// }
|
|
}
|