rj-action-library/Runtime/Actions/Node/SetNodeState.cs

28 lines
543 B
C#
Raw Normal View History

2024-08-04 09:08:12 +00:00
using Godot;
namespace Rokojori
{
2025-11-26 14:23:59 +00:00
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/SetNodeState.svg")]
2025-01-08 18:46:17 +00:00
public partial class SetNodeState : Action
2024-08-04 09:08:12 +00:00
{
[Export]
public Node[] enable = new Node[ 0 ];
2024-08-04 09:08:12 +00:00
[Export]
public Node[] disable = new Node[ 0 ];
2024-08-04 09:08:12 +00:00
2025-01-08 18:46:17 +00:00
protected override void _OnTrigger()
2025-10-24 11:38:51 +00:00
{
CallDeferred( "SetStates" );
}
void SetStates()
2024-08-04 09:08:12 +00:00
{
Arrays.ForEach( enable, n => NodeState.Enable( n ) );
Arrays.ForEach( disable, n => NodeState.Disable( n ) );
}
}
}