public static void Trigger(MasterMenuControllerCustom menuArg, bool isOpeningArg) { e.menu = menuArg; e.isOpening = isOpeningArg; MMEventManager.TriggerEvent(e); }
/// <summary> /// Sets up list of menus that denote what menus is open. /// </summary> /// <param name="menuArg"></param> /// <param name="isOpeningArg"></param> private void RefreshOpenMenus(MasterMenuControllerCustom menuArg, bool isOpeningArg) { // if given menu is considered open when it is closing OR closed when it is opening if (openMenus.Exists(iterMenu => iterMenu == menuArg) != isOpeningArg) { // if menu opening if (isOpeningArg) { // add menu to list of open menus openMenus.Add(menuArg); } // else menu closing else { // remove menu from list of open menus openMenus.Remove(menuArg); } } }
/// <summary> /// Initializes a new instance of the struct. /// </summary> /// <param name="menuArg"></param> /// <param name="isOpeningArg"></param> public MenuActivationEvent(MasterMenuControllerCustom menuArg, bool isOpeningArg) { menu = menuArg; isOpening = isOpeningArg; }