Traveller/scripts/levelGraphEditor/RoomNode.cs
Cold-Mint 2fded22910
Attempt to serialize node data.
尝试序列化节点数据。
2024-05-14 22:26:33 +08:00

35 lines
790 B
C#

using Godot;
namespace ColdMint.scripts.levelGraphEditor;
public partial class RoomNode : GraphNode
{
private Label? _describeLabel;
private IRoomNodeData? _roomNodeData;
public IRoomNodeData? RoomNodeData
{
get => _roomNodeData;
set
{
if (_describeLabel == null || value == null) return;
Title = value.Title;
if (value.Description.Length == 0)
{
_describeLabel.Text = string.Empty;
}
else
{
_describeLabel.Text = value.Description;
}
_roomNodeData = value;
}
}
public override void _Ready()
{
base._Ready();
_describeLabel = GetNode<Label>("DescribeLabel");
}
}