コード例 #1
0
        public static void Remove(GameObject pNode)
        {
            Debug.Assert(pNode != null);
            GameObjectManager pMan        = GameObjectManager.GetInstance();
            GameObject        pSafetyNode = pNode;
            GameObject        pTmp        = pNode;
            GameObject        pRoot       = null;

            while (pTmp != null)
            {
                pRoot = pTmp;
                pTmp  = (GameObject)pTmp.pParent;
            }
            GameObjectNode pTree = (GameObjectNode)pMan.pActive;

            while (pTree != null)
            {
                if (pTree.pGameObject == pRoot)
                {
                    break;
                }
                pTree = (GameObjectNode)pTree.pDNext;
            }
            Debug.Assert(pTree != null);
            Debug.Assert(pTree.pGameObject != null);
            pMan.pRoot.SetRoot(pTree.pGameObject);
            pMan.pRoot.Remove(pNode);
        }
コード例 #2
0
        public static void Remove(GameObjectNode goNode)
        {
            Debug.Assert(goNode != null);
            GameObjectManager goMan = GameObjectManager.GetInstance();

            goMan.BaseRemove(goNode);
        }
コード例 #3
0
        public static GameObject Find(GameObjectName goName, int index = 0)
        {
            GameObjectManager goMan    = GameObjectManager.GetInstance();
            GameObjectNode    pRoot    = (GameObjectNode)goMan.pActive;
            GameObject        pGameObj = null;

            bool found = false;

            while (pRoot != null && found == false)
            {
                PCSTreeForwardIterator iter = new PCSTreeForwardIterator(pRoot.pGameObject);
                pGameObj = (GameObject)iter.First();

                while (!iter.IsDone())
                {
                    if ((pGameObj.gameObjectName == goName) && (pGameObj.index == index))
                    {
                        found = true;
                        break;
                    }
                    pGameObj = (GameObject)iter.Next();
                }
                pRoot = (GameObjectNode)pRoot.pDNext;
            }
            return(pGameObj);
        }
コード例 #4
0
        public static void Dump()//BROKEN
        {
            GameObjectManager pMan = GameObjectManager.GetInstance();

            Debug.Assert(pMan != null);

            pMan.BaseDump();
        }
コード例 #5
0
        public static void SetActive(GameObjectManager pSBMan)
        {
            GameObjectManager pMan = GameObjectManager.GetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pSBMan != null);
            GameObjectManager.pActiveMan = pSBMan;
        }
コード例 #6
0
        public static GameObjectNode AttachTree(GameObject pGameObject)
        {
            Debug.Assert(pGameObject != null);
            GameObjectManager goMan = GameObjectManager.GetInstance();

            GameObjectNode goNode = (GameObjectNode)goMan.BaseAdd();

            Debug.Assert(goNode != null);

            goNode.Set(pGameObject);
            return(goNode);
        }
コード例 #7
0
        public static void Update()
        {
            GameObjectManager goMan  = GameObjectManager.GetInstance();
            GameObjectNode    goNode = (GameObjectNode)goMan.pActive;

            while (goNode != null)
            {
                PCSTreeReverseIterator iter = new PCSTreeReverseIterator(goNode.pGameObject);
                GameObject             go   = (GameObject)iter.First();
                while (!iter.IsDone())
                {
                    go.Update();
                    go = (GameObject)iter.Next();
                }
                goNode = (GameObjectNode)goNode.pDNext;
            }
        }
コード例 #8
0
        public static void Insert(GameObject pGameObject, GameObject pParent)
        {
            GameObjectManager goMan = GameObjectManager.GetInstance();

            Debug.Assert(pGameObject != null);

            if (pParent == null)
            {
                GameObjectManager.AttachTree(pGameObject);
            }
            else
            {
                Debug.Assert(pParent != null);

                goMan.pRoot.SetRoot(pParent);
                goMan.pRoot.Insert(pGameObject, pParent);
            }
        }
コード例 #9
0
        public static void Destroy()
        {
            GameObjectManager goMan = GameObjectManager.GetInstance();

            goMan.BaseDestroy();
        }
コード例 #10
0
        public static PCSTree GetRootTree()
        {
            GameObjectManager goMan = GameObjectManager.GetInstance();

            return(goMan.pRoot);
        }