public void EnableMenu(string menuName) { if (string.IsNullOrEmpty(menuName)) { return; } if (menus.ContainsKey(menuName)) { DisableActiveMenu(); activeWidget = menus[menuName]; activeWidget.EnabelWidget(); } 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 exists in dictionary!"); return; } if (menuWidget == null) { return; } menus.Add(menuName, menuWidget); }