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

23 lines
593 B
C#
Raw Normal View History

2024-08-04 09:08:12 +00:00
using Godot;
namespace Rokojori
{
2024-11-13 11:57:10 +00:00
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/RJOnEvent.svg") ]
2024-08-04 09:08:12 +00:00
public partial class OnPhysicsProcess : Node
{
2024-08-04 16:57:47 +00:00
/** <summary for="field actions">Actions to execute</summary>*/
2024-08-04 09:08:12 +00:00
[Export]
2025-01-08 18:46:17 +00:00
public Action[] actions;
2024-08-04 16:57:47 +00:00
2025-01-08 18:46:17 +00:00
/** <summary for="field triggerDirectChildren">Whether to execute Action child nodes</summary>*/
2024-08-04 16:57:47 +00:00
[Export]
public bool triggerDirectChildren = true;
2024-08-04 09:08:12 +00:00
public override void _PhysicsProcess( double delta )
{
2025-01-08 18:46:17 +00:00
Action.TriggerAll( actions, this, triggerDirectChildren );
2024-08-04 09:08:12 +00:00
}
}
}