2024-05-04 08:26:16 +00:00
|
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
|
|
{
|
|
|
|
public class Actions
|
|
|
|
{
|
2024-05-05 07:52:06 +00:00
|
|
|
public static void Trigger( RJAction action )
|
2024-05-04 08:26:16 +00:00
|
|
|
{
|
|
|
|
if ( action == null )
|
|
|
|
{
|
|
|
|
return;
|
2024-05-12 17:03:20 +00:00
|
|
|
}
|
2024-05-04 08:26:16 +00:00
|
|
|
|
|
|
|
action.Trigger();
|
|
|
|
}
|
2024-08-04 09:08:12 +00:00
|
|
|
|
|
|
|
public static void TriggerAll( RJAction[] actions, Node target, bool triggerDirectChildren )
|
|
|
|
{
|
|
|
|
if ( actions != null )
|
|
|
|
{
|
|
|
|
for ( int i = 0; i < actions.Length; i++ )
|
|
|
|
{
|
|
|
|
Actions.Trigger( actions[ i ] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! triggerDirectChildren )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Nodes.ForEachDirectChild<RJAction>( target, a => Actions.Trigger( a ) );
|
|
|
|
}
|
2024-08-04 16:57:47 +00:00
|
|
|
|
|
|
|
public static void TriggerAll( RJAction action, Node target, bool triggerDirectChildren )
|
|
|
|
{
|
|
|
|
if ( action != null )
|
|
|
|
{
|
|
|
|
Actions.Trigger( action );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! triggerDirectChildren )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Nodes.ForEachDirectChild<RJAction>( target, a => Actions.Trigger( a ) );
|
|
|
|
}
|
2024-05-04 08:26:16 +00:00
|
|
|
}
|
|
|
|
}
|