Пример #1
0
        private void StartPanelAsCurrent(string name)
        {
            var panel = Utils.FindDirectChildComponent <PanelBase>(name, panelParent);

            if (panel == null)
            {
                panel = Utils.FindDirectChildComponent <PanelBase>("OPPanel", panelParent);
            }

            panel.DoStart(this);
            string camera = panel.cameraScene;

            if (!string.IsNullOrEmpty(camera))
            {
                Director.Instance.ChangeCamera(camera);
            }
            currentPanel = panel;
        }
Пример #2
0
        private void SetNextPanel()
        {
            PanelBase panel = null;

            for (int i = 0; i < data.phase0.Count; ++i)
            {
                string endphase = i == (data.phase0.Count - 1) ? "ReadyPanel" : "TrainLeaderPanel";

                string[] substring = data.phase0[i].time.Split(new char[] { ',' });

                panel = Utils.FindDirectChildComponent <PanelBase>("TrainLeaderPanel", panelParent);
                panel.nextPanelOrder.Add(new NextPanel("TrainPlayTurnPanel", substring[0]));

                if (substring.Length == 2 || substring[2] == "0")
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("TrainPlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[1]));
                }
                else if (substring.Length == 3)
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("TrainPlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel("TrainSettlePanel", substring[1]));

                    panel = Utils.FindDirectChildComponent <PanelBase>("TrainSettlePanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[2]));
                }
            }

            for (int i = 0; i < data.phase1.Count; ++i)
            {
                string endphase = i == (data.phase1.Count - 1) ? "CheerPanel" : "LeaderPanel";

                string[] substring = data.phase1[i].time.Split(new char[] { ',' });

                panel = Utils.FindDirectChildComponent <PanelBase>("LeaderPanel", panelParent);
                panel.nextPanelOrder.Add(new NextPanel("PlayTurnPanel", substring[0]));

                if (substring.Length == 2 || substring[2] == "0")
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[1]));
                }
                else if (substring.Length == 3)
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel("SettlePanel", substring[1]));

                    panel = Utils.FindDirectChildComponent <PanelBase>("SettlePanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[2]));
                }
            }

            for (int i = 0; i < data.phase2.Count; ++i)
            {
                string endphase = i == (data.phase2.Count - 1) ? "SecondCheerPanel" : "LeaderPanel";

                string[] substring = data.phase2[i].time.Split(new char[] { ',' });

                panel = Utils.FindDirectChildComponent <PanelBase>("LeaderPanel", panelParent);
                panel.nextPanelOrder.Add(new NextPanel("PlayTurnPanel", substring[0]));

                if (substring.Length == 2 || substring[2] == "0")
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[1]));
                }
                else if (substring.Length == 3)
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel("SettlePanel", substring[1]));

                    panel = Utils.FindDirectChildComponent <PanelBase>("SettlePanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[2]));
                }
            }

            for (int i = 0; i < data.phase3.Count; ++i)
            {
                string endphase = i == (data.phase3.Count - 1) ? "EDPanel" : "LeaderPanel";

                string[] substring = data.phase3[i].time.Split(new char[] { ',' });

                panel = Utils.FindDirectChildComponent <PanelBase>("LeaderPanel", panelParent);
                panel.nextPanelOrder.Add(new NextPanel("PlayTurnPanel", substring[0]));

                if (substring.Length == 2 || substring[2] == "0")
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[1]));
                }
                else if (substring.Length == 3)
                {
                    panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel("SettlePanel", substring[1]));

                    panel = Utils.FindDirectChildComponent <PanelBase>("SettlePanel", panelParent);
                    panel.nextPanelOrder.Add(new NextPanel(endphase, substring[2]));
                }
            }

            panel = Utils.FindDirectChildComponent <PanelBase>("TrainLeaderPanel", panelParent);
            panel.nextPanelOrder.Reverse();
            panel = Utils.FindDirectChildComponent <PanelBase>("TrainPlayTurnPanel", panelParent);
            panel.nextPanelOrder.Reverse();
            panel = Utils.FindDirectChildComponent <PanelBase>("TrainSettlePanel", panelParent);
            panel.nextPanelOrder.Reverse();
            panel = Utils.FindDirectChildComponent <PanelBase>("LeaderPanel", panelParent);
            panel.nextPanelOrder.Reverse();
            panel = Utils.FindDirectChildComponent <PanelBase>("PlayTurnPanel", panelParent);
            panel.nextPanelOrder.Reverse();
            panel = Utils.FindDirectChildComponent <PanelBase>("SettlePanel", panelParent);
            panel.nextPanelOrder.Reverse();
        }