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 OnBeforeSerialize(BTAsset btAsset) { base.OnBeforeSerialize(btAsset); if (m_child != null) { m_child.OnBeforeSerialize(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 (string.IsNullOrEmpty(m_behaviourTreeID)) { m_behaviourTreeID = BTUtils.GenerateUniqueStringID(); } btAsset.SetSubtreeAsset(m_behaviourTreeID, m_behaviourTreeAsset); }
public virtual void OnBeforeSerialize(BTAsset btAsset) { foreach (var constraint in m_constraints) { constraint.OnBeforeSerialize(btAsset); } foreach (var service in m_services) { service.OnBeforeSerialize(btAsset); } }
public override void OnAdd() { base.OnAdd(); var bt = AssetResources.LoadAssetImmediatly(BtPath) as BTAsset; m_behaviourTree = bt; m_blackboard = new Blackboard(); if (m_behaviourTree != null) { m_btInstance = m_behaviourTree.CreateRuntimeTree(); } m_timeElapsedSinceLastUpdate = 0.0f; m_isRunning = true; }
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); } } }
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 void setBehaviourTree(BTAsset asset) { m_behaviourTree = asset; }
public override void OnAfterDeserialize(BTAsset btAsset) { base.OnAfterDeserialize(btAsset); m_behaviourTreeAsset = btAsset.GetSubtreeAsset(m_behaviourTreeID); }
public virtual void OnAfterDeserialize(BTAsset btAsset) { }
public virtual void OnBeforeSerialize(BTAsset btAsset) { }