cirnogodot/Scripts/Actors/ChestMarker.cs
2025-04-29 12:12:47 +02:00

31 lines
No EOL
656 B
C#

using Godot;
namespace Cirno.Scripts.Actors;
[Tool]
public partial class ChestMarker : FeatureMarker
{
private Texture2D _markerTexture;
[Export]
public Texture2D MarkerTexture
{
get => _markerTexture;
set
{
_markerTexture = value;
if (Engine.IsEditorHint())
{
QueueRedraw();
}
}
}
public override void _Draw()
{
if (!Engine.IsEditorHint()) return;
if (MarkerTexture is null) return;
DrawTexture(MarkerTexture, -new Vector2(MarkerTexture.GetWidth() / 2f, MarkerTexture.GetHeight() / 2f));
}
}