28 lines
708 B
C#
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;
|
|
}
|
|
}
|
|
} |