2023-10-11 20:26:45 +00:00
|
|
|
using System;
|
|
|
|
using BehaviorDesigner.Runtime.Tasks;
|
|
|
|
using UnityEngine;
|
2023-10-16 07:27:29 +00:00
|
|
|
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
2023-10-11 20:26:45 +00:00
|
|
|
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
namespace BlueWaterProject
|
|
|
|
{
|
|
|
|
[TaskCategory("Custom/SharedVariable")]
|
|
|
|
[Serializable]
|
2023-10-16 07:27:29 +00:00
|
|
|
public class SetTarget : Action
|
2023-10-11 20:26:45 +00:00
|
|
|
{
|
|
|
|
[SerializeField] private Collider collider;
|
|
|
|
|
2023-10-16 07:27:29 +00:00
|
|
|
private IAiView iAiView;
|
|
|
|
|
|
|
|
public override void OnAwake()
|
|
|
|
{
|
|
|
|
iAiView = transform.GetComponent<IAiView>();
|
|
|
|
}
|
|
|
|
|
2023-10-11 20:26:45 +00:00
|
|
|
public override TaskStatus OnUpdate()
|
|
|
|
{
|
2023-10-16 07:27:29 +00:00
|
|
|
iAiView.SetTarget(collider);
|
2023-10-11 20:26:45 +00:00
|
|
|
|
|
|
|
return TaskStatus.Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|