protected override void OnInit(BTAsset asset) { for (int i = 0; i < m_children.Count; i++) { m_children[i]._init(asset); } }
protected override void OnInit(BTAsset asset) { if (m_child != null) { m_child._init(asset); } }
public void Init(BTAsset asset) { btAsset = asset; if (root != null) { root._init(asset); } }
public override void OnAfterDeserialize(BTAsset btAsset) { base.OnAfterDeserialize(btAsset); for (int i = 0; i < m_children.Count; i++) { m_children[i].OnAfterDeserialize(btAsset); } }
public override void OnAfterDeserialize(BTAsset btAsset) { base.OnAfterDeserialize(btAsset); if (m_child != null) { m_child.OnAfterDeserialize(btAsset); } }
public override void OnBeforeSerialize(BTAsset btAsset) { base.OnBeforeSerialize(btAsset); if (m_child != null) { m_child.OnBeforeSerialize(btAsset); } }
protected override void OnInit(BTAsset asset) { m_weights = new float[m_children.Count]; for (int i = 0; i < m_children.Count; i++) { m_children[i]._init(asset); m_weights[i] = m_children[i].Weight; } }
public BehaviourTree(BehaviourTree inst) { guidString = inst.guidString; guid = GuidGen.GenUniqueGUID(); title = inst.title; description = inst.description; root = inst.root; btAsset = inst.btAsset; ReadOnly = inst.ReadOnly; }
protected override void OnInit(BTAsset asset) { if (m_behaviourTreeAsset != null) { m_behaviourTree = m_behaviourTreeAsset.CreateRuntimeTree(); if (m_behaviourTree != null) { m_behaviourTree.Root._init(asset); } } }
public override void OnBeforeSerialize(BTAsset btAsset) { base.OnBeforeSerialize(btAsset); if (string.IsNullOrEmpty(m_behaviourTreeID)) { m_behaviourTreeID = BTUtils.GenerateUniqueStringID(); } btAsset.SetSubtreeAsset(m_behaviourTreeID, m_behaviourTreeAsset); }
public virtual void OnBeforeSerialize(BTAsset btAsset) { guid = BTUtils.GenUniqueGUID(); foreach (var constraint in m_constraints) { constraint.OnBeforeSerialize(btAsset); } foreach (var service in m_services) { service.OnBeforeSerialize(btAsset); } }
public void SetSubtreeAsset(string subtreeID, BTAsset subtreeAsset) { if (!string.IsNullOrEmpty(subtreeID)) { AssetIDPair subtree = m_subtrees.Find(obj => obj.assetID == subtreeID); if (subtree != null) { subtree.asset = subtreeAsset; } else { subtree = new AssetIDPair(); subtree.asset = subtreeAsset; subtree.assetID = subtreeID; m_subtrees.Add(subtree); } } }
protected override void OnInit(BTAsset asset) { if (SubTreeIndex >= 0) { if (asset is RootTreeAsset) { RootTreeAsset rootAsset = asset as RootTreeAsset; m_behaviourTree = rootAsset.CreateRuntimeSubTree(SubTreeIndex); if (m_behaviourTree != null) { m_behaviourTree.Root._init(asset); } else { UnityEngine.Debug.LogError("RunBehaviourIndex.OnInit: CreateRuntimeSubTree failed!!"); } } } }
public virtual void OnAfterDeserialize(BTAsset btAsset) { if (m_constraints == null) { m_constraints = new List <Constraint>(); } if (m_services == null) { m_services = new List <Service>(); } foreach (var constraint in m_constraints) { constraint.OnAfterDeserialize(btAsset); } foreach (var service in m_services) { service.OnAfterDeserialize(btAsset); } }
public override void OnAfterDeserialize(BTAsset btAsset) { base.OnAfterDeserialize(btAsset); }
public void _init(BTAsset asset) { OnInit(asset); }
protected virtual void OnInit(BTAsset asset) { }
public virtual void OnBeforeSerialize(BTAsset btAsset) { }
public override void OnBeforeSerialize(BTAsset btAsset) { base.OnBeforeSerialize(btAsset); }
public override void OnAfterDeserialize(BTAsset btAsset) { base.OnAfterDeserialize(btAsset); m_behaviourTreeAsset = btAsset.GetSubtreeAsset(m_behaviourTreeID); }
public virtual void OnAfterDeserialize(BTAsset btAsset) { }