28 lines
726 B
C#
28 lines
726 B
C#
![]() |
using System;
|
||
|
using BehaviorDesigner.Runtime.Tasks;
|
||
|
using BlueWater.Interfaces;
|
||
|
using BlueWater.Players.Tycoons;
|
||
|
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||
|
|
||
|
namespace BlueWater.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;
|
||
|
}
|
||
|
}
|
||
|
}
|