AIobj = PhotonNetwork.InstantiateSceneObject(AI_model[0].Name, new Vector3(UnityEngine.Random.insideUnitCircle.x * 10, 0.1f, UnityEngine.Random.insideUnitCircle.y * 10), Quaternion.identity, 0);
BehaviorTree aitree = AIobj.GetComponent();
aitree.EnableBehavior();
aitree.FindTask().target = PlayerManager.LocalPlayerInstance;
如何动态在Task中设置参数如上,一定要在激活树后才能操作,激活相当于初始化,要不然为空。