Ejemplo n.º 1
0
    public void GameUIManager()
    {
        isGameUIManager = true;
        if (UIPanelDict.Count != 0)
        {
            ClearDict();
        }
        GameBasePanel dayNightPanel = new DayNightPanel("Panel_DayAndNight", UIPanelType.DayNightPanel, this);
        GameBasePanel wolfPanel     = new WolfPanel("Panel_Wolf", UIPanelType.WolfPanel, this);
        GameBasePanel defenderPanel = new GuardPanel("Panel_Defender", UIPanelType.GuardPanel, this);
        GameBasePanel witchPanel    = new WitchPanel("Panel_Witch", UIPanelType.WitchPanel, this);
        GameBasePanel prophetPanel  = new ProphetPanel("Panel_Prophet", UIPanelType.ProphetPanel, this);
        GameBasePanel hunterPanel   = new HunterPanel("Panel_Hunter", UIPanelType.HunterPanel, this);

        //环式责任链条
        wolfPanel.SetNextPanel(witchPanel).SetNextPanel(prophetPanel)
        .SetNextPanel(hunterPanel).SetNextPanel(defenderPanel)
        .SetNextPanel(dayNightPanel).SetNextPanel(wolfPanel);

        UIPanelDict.Add(UIPanelType.DayNightPanel, dayNightPanel);
        UIPanelDict.Add(UIPanelType.WolfPanel, wolfPanel);
        UIPanelDict.Add(UIPanelType.GuardPanel, defenderPanel);
        UIPanelDict.Add(UIPanelType.WitchPanel, witchPanel);
        UIPanelDict.Add(UIPanelType.ProphetPanel, prophetPanel);
        UIPanelDict.Add(UIPanelType.HunterPanel, hunterPanel);

        UIPanelDict[UIPanelType.WolfPanel].Show();
        GameBasePanel firstPanel = UIPanelDict[UIPanelType.WolfPanel] as GameBasePanel;

        firstPanel.EnterPanel();
        firstPanel.HandleGameAction(UIPanelType.WolfPanel);
    }
Ejemplo n.º 2
0
    protected void ChangePanelCallBack(UIPanelType otherType)
    {
        uiManager.UIPanelDict[currentUIPanelType].Hide();

        uiManager.UIPanelDict[otherType].Show();
        uiManager.UIPanelDict[otherType].EnterPanel();

        if (uiManager.isGameUIManager)
        {
            GameBasePanel nextPanel = uiManager.UIPanelDict[otherType] as GameBasePanel;
            nextPanel.HandleGameAction(otherType);
        }
    }
Ejemplo n.º 3
0
 //设置下一个操作对象
 public GameBasePanel SetNextPanel(GameBasePanel nextGamePanel)
 {
     nextPanel = nextGamePanel;
     return(nextPanel);
 }