26 lines
678 B
C#
26 lines
678 B
C#
using BehaviorDesigner.Runtime.Tasks;
|
|
using DDD.Npcs.Crews;
|
|
|
|
namespace DDD.BehaviorTrees.Actions
|
|
{
|
|
[TaskCategory("Custom/Npc/Crew")]
|
|
public class IsCompletedMission : Action
|
|
{
|
|
private Crew _crew;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
_crew = GetComponent<Crew>();
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
if (_crew.CrewInteraction != null)
|
|
{
|
|
return _crew.CrewInteraction.CanInteractionCrew() ? TaskStatus.Running : TaskStatus.Failure;
|
|
}
|
|
|
|
return _crew.IsCompletedMission() ? TaskStatus.Success : TaskStatus.Failure;
|
|
}
|
|
}
|
|
} |