Пример #1
0
 void Setup(BTreeData bTreeData)
 {
     _bTreeData         = bTreeData;
     _btRoot            = BTNode.CreateNode(_bTreeData.Root, this, null);
     _currentFrameStack = new Stack <BTNode>();
     _nextFrameStack    = new Stack <BTNode>();
     _isInitialized     = true;
 }
Пример #2
0
        void OnReadyToRegister()
        {
            BTreeData bTreeData = BTreeManager.Instance.GetBTreeData(id);

            if (bTreeData != null)
            {
                Setup(bTreeData);
            }
        }
Пример #3
0
        void LoadBTree(string treeFilePath)
        {
            TextAsset fileAsset = Resources.Load(treeFilePath) as TextAsset;

            if (fileAsset != null)
            {
                JSON js = new JSON();
                js.serialized = fileAsset.text;

                BTreeData bTreeData = new BTreeData(js);
                if (!_dictOfBTreeData.ContainsKey(bTreeData.Id))
                {
                    _dictOfBTreeData.Add(bTreeData.Id, bTreeData);
                }
                else
                {
                    Debug.Log("Error: Duplicate Btree id: " + bTreeData.Id + " in file: " + treeFilePath);
                }
            }
            else
            {
                Debug.Log("Error: Invalid Btree path: " + treeFilePath);
            }
        }