예제 #1
0
    public void StackPopup()                      //没明白
    {
        MenuInfo info = GetCurrentMenu();         //得到当前的场景

        if (info.menu == GameMenu.HeroInfoDetail) //如果当枪的场景是 HeroInfoDetail
        {
            List <MenuInfo> stacked_menus = m_MenuStack.GetRange(1, m_MenuStack.Count - 1);
            MenuInfo        stacked       = stacked_menus.Find(m => m.menu == GameMenu.HeroInfoDetail);
            if (stacked_menus.Count > 0 && stacked != null)
            {
                for (int i = 0; stacked_menus.Count > i && stacked_menus[i] != stacked; ++i)
                {
                    m_MenuStack.Remove(stacked_menus[i]);
                }
                m_MenuStack.Remove(stacked);
            }
        }

        info.AddPopup(Popup.Instance.PopStacks());
    }