rj-action-library/Runtime/WorldMap/Layers/WorldMapLayer.cs

74 lines
1.5 KiB
C#
Raw Permalink Normal View History

2025-08-31 06:05:39 +00:00
using Godot;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Rokojori
{
[Tool]
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/WorldMapLayer.svg")]
public partial class WorldMapLayer:Node
{
[Export]
public WorldMapLayerType layerType;
public void Update( WorldMap map )
{
layerType.Update( this, map );
}
#if TOOLS
public override void _Ready()
{
this._OnSignal( Node.SignalName.ChildEnteredTree,
Callable.From(
( Node node ) =>
{
if ( layerType == null )
{
return;
}
layerType.OnWorldEditorNodeUpdate( WorldMapLayerType.NodeUpdate.Added, this, node );
}
)
);
this._OnSignal( Node.SignalName.ChildExitingTree,
Callable.From(
( Node node ) =>
{
if ( layerType == null )
{
return;
}
layerType.OnWorldEditorNodeUpdate( WorldMapLayerType.NodeUpdate.Deleted, this, node );
}
)
);
this._OnSignal( Node.SignalName.ChildOrderChanged,
Callable.From(
( Node node ) =>
{
if ( layerType == null )
{
return;
}
layerType.OnWorldEditorNodeUpdate( WorldMapLayerType.NodeUpdate.Moved, this, node );
}
)
);
}
public override void _Process( double delta )
{
}
#endif
}
}