예제 #1
0
        public void EnableMenu(string menuName)
        {
            if (string.IsNullOrEmpty(menuName))
            {
                return;
            }
            if (Menus.ContainsKey(menuName))
            {
                DisableActiveMenu();

                ActiveWidget = Menus[menuName];
                ActiveWidget.gameObject.SetActive(true);
            }
            else
            {
                Debug.LogError("Menu is not available in Dictionary");
            }
        }
예제 #2
0
        public void AddMenu(string menuName, MenuWidget menuWidget)
        {
            if (string.IsNullOrEmpty(menuName))
            {
                return;
            }
            if (Menus.ContainsKey(menuName))
            {
                Debug.LogError("Menu already exist in dictionary");
                return;
            }

            if (menuWidget == null)
            {
                return;
            }
            Menus.Add(menuName, menuWidget);
        }