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"); } }
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); }