CapersProject/Assets/02.Scripts/BlueWater/BehaviorTree/Npc/Customer/Action/OrderFail.cs
2025-02-10 11:13:46 +09:00

28 lines
708 B
C#

using System;
using BehaviorDesigner.Runtime.Tasks;
using DDD.Interfaces;
using DDD.Players.Tycoons;
using Action = BehaviorDesigner.Runtime.Tasks.Action;
namespace DDD.BehaviorTrees.Actions
{
[TaskCategory("Custom/Npc/Customer")]
[Serializable]
public class OrderFail : Action
{
private TycoonPlayer _tycoonPlayer;
public override void OnAwake()
{
_tycoonPlayer = GameManager.Instance.CurrentTycoonPlayer;
}
public override TaskStatus OnUpdate()
{
var damageable = _tycoonPlayer.GetComponent<IDamageable>();
damageable?.TakeDamage(1);
return TaskStatus.Success;
}
}
}