rj-action-library/Runtime/Actions/OnProcess.cs

31 lines
749 B
C#
Raw Normal View History

2024-08-04 09:08:12 +00:00
using Godot;
namespace Rokojori
{
2025-01-21 20:58:56 +00:00
[GlobalClass, Tool, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
2024-08-04 09:08:12 +00:00
public partial class OnProcess : Node
{
/** <summary for="field actions">Actions to execute</summary>*/
[Export]
public Action[] actions = new Action[ 0 ];
2024-08-04 09:08:12 +00:00
2025-01-08 18:46:17 +00:00
/** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
2024-08-04 09:08:12 +00:00
[Export]
public bool triggerDirectChildren = true;
[Export]
public bool executeInEditor = false;
public override void _Process( double delta )
{
if ( Engine.IsEditorHint() && ! executeInEditor )
{
return;
}
2025-01-08 18:46:17 +00:00
Action.TriggerAll( actions, this, triggerDirectChildren );
2024-08-04 09:08:12 +00:00
}
}
}