I am trying in a manual loop to update the externalBehavior of the next node. For example in the update of a conditional node I am running this, but I am hitting an out of range exception :
What I want is to have a set of purposes stored as external behaviors in a core agent manager, who will monitor the requirements update the available tasks.
C#:
public override BehaviorDesigner.Runtime.Tasks.TaskStatus OnUpdate()
{
if (treeGenerator == null)
treeGenerator = GameObject.FindObjectOfType<GiveMeTree>();
dest = treeGenerator.GetRandomPos();
var randomVal = UnityEngine.Object.Instantiate(treeGenerator.GetTree());
randomVal.Init();
reference.externalBehaviors = new ExternalBehavior[] { randomVal };
return BehaviorDesigner.Runtime.Tasks.TaskStatus.Success;
}
What I want is to have a set of purposes stored as external behaviors in a core agent manager, who will monitor the requirements update the available tasks.