Beispiel #1
0
        private void AttachActor(LevelBase level, IGraphNodeGroup nodeGroup)
        {
            Debug.Assert(level != null);

            nodeGroup.BhvOnEnter();
            level.AttachChild(nodeGroup);
        }
Beispiel #2
0
        public void DetachAllChildren()
        {
            for (int idx = 0; idx < this.children.Count; ++idx)
            {
                if (children[idx] is IGraphNodeGroup)
                {
                    IGraphNodeGroup nodeGroup = children[idx] as IGraphNodeGroup;
                    nodeGroup.DetachAllChildren();
                }

                DetachChild(this.children[idx]);
            }
        }
Beispiel #3
0
    public void ReleaseWorld()
    {
        if (m_rootNodeGroup != null)
        {
            m_rootNodeGroup.BhvOnLeave();
            m_rootNodeGroup = null;
        }

        if (m_worldLevel != null)
        {
            m_worldLevel.ClearFirstLevel();
            m_worldLevel = null;
        }
    }
Beispiel #4
0
    public void CreateWorld()
    {
        m_worldLevel = new WorldLevel();

        if (m_worldLevel != null)
        {
            m_worldLevel.CreateFirstLevel();
        }

        m_rootNodeGroup = m_worldLevel;

        if (m_rootNodeGroup != null)
        {
            m_rootNodeGroup.BhvOnEnter();
        }
    }
Beispiel #5
0
        public void DestroyPlayer(IEntity entity)
        {
            eCombatType combatType = entity.CombatType;

            IGraphNodeGroup parentnode = entity.Main.Parent as IGraphNodeGroup;

            Debug.Assert(parentnode != null);

            entity.Terminate();
            Remove(entity.CombatType, entity.NetID);

            LevelBase level = Global.NodeGraphMgr.WorldLevelRoot.ActorLevel;

            DetachActor(level, parentnode);

            //Global.FactoryMgr.Node.Destroy(actor);
        }
Beispiel #6
0
        public virtual bool OnMessage(IMessage message)
        {
            for (int idx = 0; idx < children.Count; ++idx)
            {
                if (children[idx] == null)
                {
                    continue;
                }

                if (children[idx] is IGraphNodeGroup)
                {
                    IGraphNodeGroup nodeGroup = children[idx] as IGraphNodeGroup;
                    if (nodeGroup.OnMessage(message))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #7
0
        private void DetachActor(LevelBase level, IGraphNodeGroup nodeGroup)
        {
            Debug.Assert(level != null);

            level.DetachChild(nodeGroup);                                                      // 레벨에서 삭제하고

            nodeGroup.BhvOnLeave();                                                            //자식들을 종료시키고

            List <GraphMonoPoolNode> lstPoolNodes = nodeGroup.GetChilds <GraphMonoPoolNode>(); // 풀노드만 빼온후

            nodeGroup.DetachAllChildren();                                                     //자식들을 제거함

            for (int i = 0; i < lstPoolNodes.Count; i++)
            {
                GraphMonoPoolNode poolNode = lstPoolNodes[i];
                poolNode.Unlock();
                Global.FactoryMgr.FastDestory(poolNode); //다시 풀링으로..
            }

            lstPoolNodes.Clear();
        }