예제 #1
0
 protected override void OnInit(BTAsset asset)
 {
     for (int i = 0; i < m_children.Count; i++)
     {
         m_children[i]._init(asset);
     }
 }
예제 #2
0
 protected override void OnInit(BTAsset asset)
 {
     if (m_child != null)
     {
         m_child._init(asset);
     }
 }
예제 #3
0
 public void Init(BTAsset asset)
 {
     btAsset = asset;
     if (root != null)
     {
         root._init(asset);
     }
 }
예제 #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);
            }
        }
예제 #5
0
        public override void OnAfterDeserialize(BTAsset btAsset)
        {
            base.OnAfterDeserialize(btAsset);

            if (m_child != null)
            {
                m_child.OnAfterDeserialize(btAsset);
            }
        }
예제 #6
0
        public override void OnBeforeSerialize(BTAsset btAsset)
        {
            base.OnBeforeSerialize(btAsset);

            if (m_child != null)
            {
                m_child.OnBeforeSerialize(btAsset);
            }
        }
예제 #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;
            }
        }
예제 #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;
 }
예제 #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);
         }
     }
 }
예제 #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);
        }
예제 #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);
            }
        }
예제 #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);
         }
     }
 }
예제 #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!!");
             }
         }
     }
 }
예제 #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);
            }
        }
예제 #15
0
 public override void OnAfterDeserialize(BTAsset btAsset)
 {
     base.OnAfterDeserialize(btAsset);
 }
예제 #16
0
 public void _init(BTAsset asset)
 {
     OnInit(asset);
 }
예제 #17
0
 protected virtual void OnInit(BTAsset asset)
 {
 }
예제 #18
0
 public virtual void OnBeforeSerialize(BTAsset btAsset)
 {
 }
예제 #19
0
 public override void OnBeforeSerialize(BTAsset btAsset)
 {
     base.OnBeforeSerialize(btAsset);
 }
예제 #20
0
        public override void OnAfterDeserialize(BTAsset btAsset)
        {
            base.OnAfterDeserialize(btAsset);

            m_behaviourTreeAsset = btAsset.GetSubtreeAsset(m_behaviourTreeID);
        }
예제 #21
0
 public virtual void OnAfterDeserialize(BTAsset btAsset)
 {
 }