IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/Utility/ForceFinishGraph.cs

23 lines
633 B
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
using ParadoxNotion;
using ParadoxNotion.Design;
using NodeCanvas.Framework;
namespace NodeCanvas.Tasks.Actions
{
[Category("✫ Utility")]
[Description("Force Finish the current graph this Task is assigned to.")]
public class ForceFinishGraph : ActionTask
{
public CompactStatus finishStatus = CompactStatus.Success;
protected override void OnExecute() {
var graph = ownerSystem as Graph;
if ( graph != null ) {
graph.Stop(finishStatus == CompactStatus.Success);
}
EndAction(finishStatus == CompactStatus.Success);
}
}
}