Ejemplo n.º 1
0
 protected override void OnInit(BTAsset asset)
 {
     for (int i = 0; i < m_children.Count; i++)
     {
         m_children[i]._init(asset);
     }
 }
Ejemplo n.º 2
0
 protected override void OnInit(BTAsset asset)
 {
     if (m_child != null)
     {
         m_child._init(asset);
     }
 }
Ejemplo n.º 3
0
 public void Init(BTAsset asset)
 {
     btAsset = asset;
     if (root != null)
     {
         root._init(asset);
     }
 }
Ejemplo n.º 4
0
        public override void OnAfterDeserialize(BTAsset btAsset)
        {
            base.OnAfterDeserialize(btAsset);

            for (int i = 0; i < m_children.Count; i++)
            {
                m_children[i].OnAfterDeserialize(btAsset);
            }
        }
Ejemplo n.º 5
0
        public override void OnAfterDeserialize(BTAsset btAsset)
        {
            base.OnAfterDeserialize(btAsset);

            if (m_child != null)
            {
                m_child.OnAfterDeserialize(btAsset);
            }
        }
Ejemplo n.º 6
0
        public override void OnBeforeSerialize(BTAsset btAsset)
        {
            base.OnBeforeSerialize(btAsset);

            if (m_child != null)
            {
                m_child.OnBeforeSerialize(btAsset);
            }
        }
Ejemplo n.º 7
0
        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;
            }
        }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
 protected override void OnInit(BTAsset asset)
 {
     if (m_behaviourTreeAsset != null)
     {
         m_behaviourTree = m_behaviourTreeAsset.CreateRuntimeTree();
         if (m_behaviourTree != null)
         {
             m_behaviourTree.Root._init(asset);
         }
     }
 }
Ejemplo n.º 10
0
        public override void OnBeforeSerialize(BTAsset btAsset)
        {
            base.OnBeforeSerialize(btAsset);

            if (string.IsNullOrEmpty(m_behaviourTreeID))
            {
                m_behaviourTreeID = BTUtils.GenerateUniqueStringID();
            }

            btAsset.SetSubtreeAsset(m_behaviourTreeID, m_behaviourTreeAsset);
        }
Ejemplo n.º 11
0
        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);
            }
        }
Ejemplo n.º 12
0
 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);
         }
     }
 }
Ejemplo n.º 13
0
 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!!");
             }
         }
     }
 }
Ejemplo n.º 14
0
        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);
            }
        }
Ejemplo n.º 15
0
 public override void OnAfterDeserialize(BTAsset btAsset)
 {
     base.OnAfterDeserialize(btAsset);
 }
Ejemplo n.º 16
0
 public void _init(BTAsset asset)
 {
     OnInit(asset);
 }
Ejemplo n.º 17
0
 protected virtual void OnInit(BTAsset asset)
 {
 }
Ejemplo n.º 18
0
 public virtual void OnBeforeSerialize(BTAsset btAsset)
 {
 }
Ejemplo n.º 19
0
 public override void OnBeforeSerialize(BTAsset btAsset)
 {
     base.OnBeforeSerialize(btAsset);
 }
Ejemplo n.º 20
0
        public override void OnAfterDeserialize(BTAsset btAsset)
        {
            base.OnAfterDeserialize(btAsset);

            m_behaviourTreeAsset = btAsset.GetSubtreeAsset(m_behaviourTreeID);
        }
Ejemplo n.º 21
0
 public virtual void OnAfterDeserialize(BTAsset btAsset)
 {
 }