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

26 lines
638 B
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
namespace NodeCanvas.Tasks.Actions
{
[Category("✫ Utility")]
public class Wait : ActionTask
{
public BBParameter<float> waitTime = 1f;
public CompactStatus finishStatus = CompactStatus.Success;
protected override string info {
get { return string.Format("Wait {0} sec.", waitTime); }
}
protected override void OnUpdate() {
if ( elapsedTime >= waitTime.value ) {
EndAction(finishStatus == CompactStatus.Success ? true : false);
}
}
}
}