示例#1
0
        public void LeaveScene(XGameSceneNode node)
        {
            node.scene.LeaveScene();
            int index = CurrScenes.Count - 1;

            if (node == CurrScenes[index])
            {
                CurrScenes.RemoveAt(index);
            }
        }
示例#2
0
        //查找切换到节点node,进入的节点列表
        public void FindChangeSceneList(XGameSceneNode target, List <XGameSceneNode> enterScenes, List <XGameSceneNode> leaveScenes)
        {
            //查找待进入的场景列表
            enterScenes.Clear();
            while (target != null)
            {
                if (CurrScenes.Contains(target))
                {
                    break;
                }
                enterScenes.Add(target);
                target = target.parent;
            }
            enterScenes.Reverse();

            //查找待退出的场景列表
            leaveScenes.Clear();
            if (target == null)
            {
                leaveScenes.AddRange(CurrScenes);
            }
            else
            {
                var flag = false;
                foreach (var node in CurrScenes)
                {
                    if (node == target)
                    {
                        flag = true;
                        continue;
                    }
                    if (flag)
                    {
                        leaveScenes.Add(node);
                    }
                }
            }
            leaveScenes.Reverse();
        }
示例#3
0
 public void EnterScene(XGameSceneNode node)
 {
     node.scene.EnterScene();
     CurrScenes.Add(node);
 }