25 lines
577 B
C#
25 lines
577 B
C#
using System;
|
|
using BehaviorDesigner.Runtime;
|
|
using BehaviorDesigner.Runtime.Tasks;
|
|
using UnityEngine;
|
|
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
|
|
|
namespace DDD.BehaviorTrees.Actions
|
|
{
|
|
[TaskCategory("Custom")]
|
|
[Serializable]
|
|
public class AddSharedInt : Action
|
|
{
|
|
[SerializeField, RequiredField]
|
|
private SharedInt _sharedInt;
|
|
|
|
[SerializeField]
|
|
private int _value;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
_sharedInt.Value += _value;
|
|
return TaskStatus.Success;
|
|
}
|
|
}
|
|
} |