using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestAgent: behaviac.Agent
{
public string bTName = "BT_Tree";
private behaviac.EBTStatus _status = behaviac.EBTStatus.BT_RUNNING;
private void Awake()
{
initBehaviac();
initAgent();
}
private void Update()
{
if (isExcuteTree() == false) return;
behaviac.Workspace.Instance.DebugUpdate();
_status = this.btexec();
}
private void initBehaviac()
{
behaviac.Workspace.Instance.FilePath = Application.streamingAssetsPath;
behaviac.Workspace.Instance.FileFormat = behaviac.Workspace.EFileFormat.EFF_xml;
RegisterInstanceName<TestAgent>("TestAgent");
}
private bool initAgent()
{
bool bRet = this.btload(bTName );
if (!bRet)
UnityEngine.Debug.LogError("Behavior tree data load failed! " + bTName );
else
this.btsetcurrent(bTName );
return bRet;
}
private void isExcuteTree()
{
return true;
}
}
|