rokojori_action_library/Runtime/Actions/LogMessage.cs

50 lines
737 B
C#

using Godot;
using Rokojori.Extensions;
namespace Rokojori
{
[Tool]
[GlobalClass ]
[RokojoriActionCoreExport]
public partial class LogMessage : Action
{
[Export]
public string message;
[Export]
public Node node;
[Export]
public bool printPath;
protected override void _OnTrigger()
{
if ( printPath )
{
if ( node != null )
{
this.LogInfo( message, node );
}
else
{
this.LogInfo( message );
}
}
else
{
if ( node != null )
{
RJLog.Log( message, node );
}
else
{
RJLog.Log( message );
}
}
}
}
}