IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/Utility/DebugLogVariable.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

35 lines
1.1 KiB
C#

using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
namespace NodeCanvas.Tasks.Actions
{
[Category("✫ Utility")]
[Description("Logs the value of a variable in the console")]
[System.Obsolete("Use Debug Log Text")]
public class DebugLogVariable : ActionTask
{
[BlackboardOnly]
public BBParameter<object> log;
public BBParameter<string> prefix;
public float secondsToRun = 1f;
public CompactStatus finishStatus = CompactStatus.Success;
protected override string info {
get { return "Log '" + log + "'" + ( secondsToRun > 0 ? " for " + secondsToRun + " sec." : "" ); }
}
protected override void OnExecute() {
ParadoxNotion.Services.Logger.Log(string.Format("<b>({0}) ({1}) | Var '{2}' = </b> {3}", agent.gameObject.name, prefix.value, log.name, log.value), LogTag.EXECUTION, this);
}
protected override void OnUpdate() {
if ( elapsedTime >= secondsToRun ) {
EndAction(finishStatus == CompactStatus.Success ? true : false);
}
}
}
}