Пример #1
0
 private void AddHistory()
 {
     MenuHistory.Add(this);
     if (MenuHistory.Count > MaxHistoryCount)
     {
         MenuHistory.RemoveAt(0);
     }
 }
Пример #2
0
    protected void ShowPreviousMenu(BaseUI <T> exceptUI = null)
    {
        if (exceptUI != null) // exceptUI는 제외 menuHistory에서 제거하자.
        {
            MenuHistory.RemoveAll(x => x == exceptUI);
        }

        int lastIndex = MenuHistory.Count - 1;

        if (lastIndex == -1)
        {
            Debug.Log("보여줄 메뉴가 없다");
            return;
        }

        var previousMenu = MenuHistory[lastIndex];

        MenuHistory.RemoveAt(lastIndex);
        previousMenu.Show();
    }