コード例 #1
0
ファイル: MenuManager.cs プロジェクト: settamaF/PixelGame
 Menu GetMenu(eMenuType type)
 {
     foreach (var menu in Menus)
     {
         if (menu.Type == type)
         {
             return(menu);
         }
     }
     Debug.LogError(type.ToString() + " not found in menu manager");
     return(null);
 }
コード例 #2
0
        public MainMenu(string i_Title, eMenuType i_MenuType, int i_SubMenusAmount)
            : base(i_Title)
        {
            m_MenuItems = new List <MenuItem>(i_SubMenusAmount);

            r_MenuType = i_MenuType;

            switch (i_MenuType)
            {
            case eMenuType.SubMenu:
                r_QuitString = k_Back;
                break;

            case eMenuType.MainMenu:
                r_QuitString = k_Exit;
                break;
            }
        }
コード例 #3
0
 /*
  * ===========================================================================================================
  * MENU ENABLING METHODS
  * ===========================================================================================================
  */
 /// <summary>
 /// Changes the menu type to show the player info
 /// </summary>
 /// <param name="caller"> The CBaseEntity component of the caller of this method </param>
 public void PlayerInfoMenuEnable(CBaseEntity caller)
 {
     menuType = eMenuType.PlayerInfo;
     this.caller = caller;
 }
コード例 #4
0
 /// <summary>
 /// Enables the patrol route selection menu.
 /// </summary>
 /// <param name='caller'>
 /// Caller.
 /// </param>
 public void PatrolDroneMenuEnable(CBaseEntity caller)
 {
     menuType = eMenuType.PatrolDrone;
     this.caller = caller;
 }
コード例 #5
0
 /// <summary>
 /// Shows the info of a building. If it has a monkey inside, show the GUI to get it out
 /// </summary>
 /// <param name="caller"> The CBuilding component of the caller of this method </param>
 public void BuildingInfoMenuEnable(CBuilding caller)
 {
     menuType = eMenuType.BuildingInfo;
     this.callerBuilding = caller;
 }
コード例 #6
0
 /// <summary>
 /// Changes the menu type to show the menu for building an extractor
 /// </summary>
 /// <param name="caller"> The CBaseEntity component of the caller of this method </param>
 public void BuildExtractorMenuEnable(CBaseEntity caller)
 {
     menuType = eMenuType.BuildExtractor;
     this.caller = caller;
 }