27 lines
617 B
C#
27 lines
617 B
C#
![]() |
using BehaviorDesigner.Runtime.Tasks;
|
||
|
|
||
|
// ReSharper disable once CheckNamespace
|
||
|
namespace BlueWaterProject
|
||
|
{
|
||
|
[TaskCategory("Custom/Action")]
|
||
|
public class Attack : Action
|
||
|
{
|
||
|
private AiController aiController;
|
||
|
|
||
|
public override void OnAwake()
|
||
|
{
|
||
|
aiController = transform.GetComponent<AiController>();
|
||
|
}
|
||
|
|
||
|
public override void OnStart()
|
||
|
{
|
||
|
aiController.Attack();
|
||
|
}
|
||
|
|
||
|
public override TaskStatus OnUpdate()
|
||
|
{
|
||
|
return aiController.IsAttackCoroutine ? TaskStatus.Running : TaskStatus.Success;
|
||
|
}
|
||
|
}
|
||
|
}
|