• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MenuState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MenuState的典型用法代码示例。如果您正苦于以下问题:C# MenuState类的具体用法?C# MenuState怎么用?C# MenuState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MenuState类属于命名空间,在下文中一共展示了MenuState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetHostGame

 public void SetHostGame(MenuState menuState)
 {
     this.menuState = menuState;
     this.dummyButton.SetActive(false);
     this.gameObject.SetActive(true);
     this.StartUDPBroadcasting();
 }
开发者ID:RavenNevermore,项目名称:EndOfLine,代码行数:7,代码来源:StartHostedGameBehaviour.cs


示例2: Back

        float timeHolder; // Waiting time

        #endregion Fields

        #region Methods

        // Back button
        public void Back()
        {
            if(menuState == MenuState.Credits)
            {
                DisableCredits();
                menuState = MenuState.Home;
            } // end if
            else if(menuState == MenuState.Help)
            {
                DisableInstructions();
                menuState = MenuState.Home;
            } // end else if
            else if(menuState == MenuState.Solo || menuState == MenuState.Multi)
            {
                DisableMapSelection();
                mapSelection = "nothing";
                guideText.text = "Please select a map";
                menuState = MenuState.Home;
            } // end else if
            else if (menuState == MenuState.Colors)
            {
                DisableColors();
                mapSelection = "nothing";
                guideText.text = "Please select a map";
                GameMaster.Instance.NumPlayers = 0;
                menuState = MenuState.Home;
            } // end else if
            else
            {
                menuState = MenuState.Home;
            } // end else
        }
开发者ID:drobbs,项目名称:TheTraveler-sr,代码行数:39,代码来源:BrentsStateMachine.cs


示例3: Start

	void Start () {
		selected = Buttons.newGame;
        oldVal = selected;
		highlightSelected (selected);
        mousedOver = false;
		ms = GameObject.Find ("Game Controller").GetComponent<MenuState>();
	}
开发者ID:Obberton13,项目名称:ComS-309-Quarter,代码行数:7,代码来源:MenuManager.cs


示例4: Main

        static void Main(string[] args)
        {
            Console.Title = "800Craft Configuration (" + Updater.CurrentRelease.VersionString + ")";
            try
            {
                Logger.Logged += OnLogged;
                Console.WriteLine("Initializing 800Craft...");
                Server.InitLibrary(args);

                if (!File.Exists(Paths.ConfigFileName))
                {
                    Console.WriteLine("Configuration ({0}) was not found. Using defaults.",
                                       Paths.ConfigFileName);
                }

                Config.Load(false, false);

                sections = (ConfigSection[])Enum.GetValues(typeof(ConfigSection));
                menuState = MenuState.SectionList;

                StateLoop();

            }
            catch (Exception ex)
            {
                Logger.LogAndReportCrash("Unhandled exception in ConfigCLI", "ConfigCLI", ex, true);
                ReportFailure(ShutdownReason.Crashed);
            }
        }
开发者ID:Desertive,项目名称:800craft,代码行数:29,代码来源:Program.cs


示例5: Draw

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(new Color(10, 10, 10));
            spriteBatch.Begin(SpriteSortMode.FrontToBack, null);
            if (menuState == MenuState.start)
            {
                spriteBatch.DrawString(AssetManager.spriteFont, "Press start or hold both sholder buttons to quit", new Vector2(100, 200), Color.White);
            }

            if (menuState == MenuState.game)
            {
                if (keyboard.IsKeyDown(Keys.P))
                {
                    menuState = MenuState.start;
                }

                foreach (GameObject g in GameObjectManager.gameObjects)
                {
                    g.Draw(spriteBatch);
                }
            }
            spriteBatch.End();

            spriteBatch.Begin();
            userInterface.Draw(spriteBatch);
            spriteBatch.End();
            base.Draw(gameTime);
        }
开发者ID:Easy-Group-Teknik,项目名称:TeknikShmup2015,代码行数:28,代码来源:Game1.cs


示例6: Menu

 public Menu(Screen screen, Mouse mouse)
 {
     _screen = screen;
     _mouse = mouse;
     _subjectBarStatus = MenuState.MENU_CLOSED;
     _objectBarStatus = MenuState.MENU_CLOSED;
 }
开发者ID:scemino,项目名称:nscumm,代码行数:7,代码来源:Menu.cs


示例7: Handle

 public static void Handle(MenuState menuState,
     Action navigationAction, Action itemsActionAction, Action itemsShowingDetailsAction, Action itemsSelectingPartyMemberAction, 
     Action giftsSelectingPartyMemberAction, Action useGiftSelectingPartyMemberAction, Action equipmentSelectingPartyMemberAction, 
     Action equipmentActionAction, Action equipmentSelectingEquipmentSlotAction, Action formationAction,
     Action statusSelectingPartyMemberAction, Action statusAction, Action questAction, Action saveFileOverrideAction,
     Action settingsAction, Action itemsAction, Action giftsAction, Action equipmentAction, Action saveAction)
 {
     switch (menuState)
     {
         case MenuState.Empty:                           /* Do nothing */                            break;
         case MenuState.Navigation:                      navigationAction();                         break;
         case MenuState.ItemsAction:                     itemsActionAction();                        break;
         case MenuState.ItemsShowingDetails:             itemsShowingDetailsAction();                break;
         case MenuState.ItemsSelectingPartyMember:       itemsSelectingPartyMemberAction();          break;
         case MenuState.GiftsSelectingPartyMember:       giftsSelectingPartyMemberAction();          break;
         case MenuState.UseGiftSelectingPartyMember:     useGiftSelectingPartyMemberAction();        break;
         case MenuState.EquipmentSelectingPartyMember:   equipmentSelectingPartyMemberAction();      break;
         case MenuState.EquipmentAction:                 equipmentActionAction();                    break;
         case MenuState.EquipmentSelectingEquipmentSlot: equipmentSelectingEquipmentSlotAction();    break;
         case MenuState.Formation:                       formationAction();                          break;
         case MenuState.StatusSelectingPartyMember:      statusSelectingPartyMemberAction();         break;
         case MenuState.Status:                          statusAction();                             break;
         case MenuState.Quest:                           questAction();                              break;
         case MenuState.SaveFileOverride:                saveFileOverrideAction();                   break;
         case MenuState.Settings:                        settingsAction();                           break;
         case MenuState.Items:                           itemsAction();                              break;
         case MenuState.Gifts:                           giftsAction();                              break;
         case MenuState.Equipment:                       equipmentAction();                          break;
         case MenuState.Save:                            saveAction();                               break;
     }
 }
开发者ID:VOChris,项目名称:VOStudios,代码行数:31,代码来源:InMenuInputHandler.cs


示例8: DisplayModeMenu

    void DisplayModeMenu()
    {
        GUI.BeginGroup(new Rect(Screen.width / 2 - 150, 50, 300, Screen.height));

        if (GUI.Button(new Rect(55, 50, 180, 40), "Survival"))
        {
            (gameControler.GetComponent("GameControler") as GameControler).gameMode = GameMode.Survival;
            Application.LoadLevel(1);
        }
        if (GUI.Button(new Rect(55, 100, 180, 40), "King of the Hill"))
        {
            (gameControler.GetComponent("GameControler") as GameControler).gameMode = GameMode.KingOfTheHill;
            Application.LoadLevel(1);
        }
        if (GUI.Button(new Rect(55, 150, 180, 40), "Time limit"))
        {
            (gameControler.GetComponent("GameControler") as GameControler).gameMode = GameMode.TimeLimit;
            Application.LoadLevel(1);
        }
        if (GUI.Button(new Rect(55, 200, 180, 40), "Pacifist"))
        {
            (gameControler.GetComponent("GameControler") as GameControler).gameMode = GameMode.Pacifist;
            Application.LoadLevel(1);
        }
        if (GUI.Button(new Rect(55, 250, 180, 40), "Previous"))
        {
            if (state == MenuState.SingleplayerMode)
                state = MenuState.MainMenu;
            else
                state = MenuState.Multiplayer;
        }

        //layout end
        GUI.EndGroup();
    }
开发者ID:Totobro,项目名称:VoidHunter,代码行数:35,代码来源:Menu.cs


示例9: Update

	// Update is called once per frame
	void Update () {
        titleSprite.enabled = false;
        gameOverSprite.enabled = false;
	    switch(menuState)
        {
            case MenuState.Starting:
                titleSprite.enabled = true;
                if (Input.GetButton("Confirm"))
                {
                    gameLoopManager.StartGame();
                    menuState = MenuState.Playing;
                }
                else
                {
                    if ((Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) && Input.GetKeyDown(KeyCode.Alpha1)) gameLoopManager.InitializeGame(1);
                    if ((Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) && Input.GetKeyDown(KeyCode.Alpha2)) gameLoopManager.InitializeGame(2);
                    if ((Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) && Input.GetKeyDown(KeyCode.Alpha3)) gameLoopManager.InitializeGame(3);
                    if ((Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) && Input.GetKeyDown(KeyCode.Alpha4)) gameLoopManager.InitializeGame(4);
                }
                break;
            case MenuState.GameOver:
                gameOverSprite.enabled = true;
                break;
        }
	}
开发者ID:sanderman01,项目名称:ggj2016,代码行数:26,代码来源:Menus.cs


示例10: MenuTransitionLeft

 void MenuTransitionLeft()
 {
     newMenuPos = new Vector2(Screen.width * 1.5f, Screen.height / 2f);
     switch (curMenu)
     {
         case MenuState.MAIN:
             //Credits
             creditsMenu.SetActive(true);
             creditsMenu.transform.position = newMenuPos;
             curMenu = MenuState.TRANSITIONING;
             lastMenu = MenuState.MAIN;
             nextMenu = MenuState.CREDITS;
             StartCoroutine(ShiftMenu());
             break;
         case MenuState.SETTINGS:
             //Main
             mainMenu.SetActive(true);
             mainMenu.transform.position = newMenuPos;
             curMenu = MenuState.TRANSITIONING;
             lastMenu = MenuState.SETTINGS;
             nextMenu = MenuState.MAIN;
             StartCoroutine(ShiftMenu());
             break;
         case MenuState.CREDITS:
             //Directions
             directionsMenu.SetActive(true);
             directionsMenu.transform.position = newMenuPos;
             curMenu = MenuState.TRANSITIONING;
             lastMenu = MenuState.CREDITS;
             nextMenu = MenuState.DIRECTIONS;
             StartCoroutine(ShiftMenu());
             break;
     }
 }
开发者ID:agentronin316,项目名称:Mobile-Roguelike,代码行数:34,代码来源:SwipeMenu.cs


示例11: Menu

        public Menu(params MenuItem[] items)
        {
            IsTouchEnabled = true;
            SizeF s = Director.Instance.WinSize;
            IsRelativeAnchorPoint = false;

            AnchorPoint = new PointF(0.5f, 0.5f);
            ContentSize = s;

            RectangleF r = UIApplication.SharedApplication.StatusBarFrame;
            DeviceOrientation orientation = Director.Instance.DeviceOrientation;

            if (orientation == DeviceOrientation.LandscapeLeft || orientation == DeviceOrientation.LandscapeRight) {
                s.Height -= r.Width;
            } else {
                s.Height -= r.Height;
            }

            SetPosition(s.Width / 2f, s.Height / 2f);

            int z = 0;

            IsRunning = true;

            foreach (MenuItem item in items) {
                AddChild(item, z);
                ++z;
            }

            _state = MenuState.Waiting;
            _selectedItem = null;
        }
开发者ID:hcxyzlm,项目名称:CocosNet-1,代码行数:32,代码来源:Menu.cs


示例12: createProfile

    bool createProfile(int aIndex)
    {
        const int CONTROL_COUNT = 3;
        bool success = false;

        float startX = Screen.width * 0.5f - m_ButtonSize.x * 0.5f;
        float startY = Screen.height * 0.5f - (m_ButtonSize.y * 0.5f * CONTROL_COUNT - m_Offset);

        Rect buttonRect = new Rect(startX, startY, m_ButtonSize.x, m_ButtonSize.y * 5);

        GUI.color = Color.black;
        GUILayout.BeginArea(buttonRect);
        GUILayout.BeginVertical();
        GUILayout.Label("Name");
        m_ProfileName = GUILayout.TextField(m_ProfileName);
        if (GUILayout.Button("Create") && m_ProfileName.Length != 0)
        {
            ProfileManager.instance.setProfle(aIndex, new Profile(m_ProfileName));
            m_State = MenuState.PROFILE_SELECTION;
            success = true;
        }
        GUILayout.EndVertical();
        GUILayout.EndArea();

        return success;
    }
开发者ID:Endevrie,项目名称:Verdant_Story,代码行数:26,代码来源:ProfileSelect.cs


示例13: DoContinueMenu

    private void DoContinueMenu()
    {
        m_scrollPosition = GUI.BeginScrollView (
            new Rect(m_itemCenter.x - 10.0f, m_itemCenter.y + 260.0f, Title.width + 20.0f, 320.0f),
            m_scrollPosition,
            new Rect(0, 0, Title.width, m_levels.Count * 60.0f),
            false, true
        );

        Rect buttonPosition = new Rect(0, 0, Title.width, 48.0f);
        foreach (FlickerLevel level in m_levels)
        {
            GUI.SetNextControlName (level.internalName);
            if (GUI.Button(buttonPosition, level.name) || (m_pressedOK && m_highlighted == level.internalName))
            {
                Application.LoadLevel(level.internalName);
            }
            buttonPosition.y += 60;
        }

        GUI.EndScrollView();

        buttonPosition = new Rect(m_itemCenter.x, m_itemCenter.y + 260.0f + 320.0f + 92.0f, Title.width, 48.0f);
        GUI.SetNextControlName ("back");
        if (GUI.Button(buttonPosition, "Back") || (m_pressedOK && m_highlighted == "back"))
        {
            m_menuState = MenuState.Main;
            m_highlighted = "levelselect";
            m_pressedOK = false;
        }
    }
开发者ID:SamOatesUniversity,项目名称:Year-3---Group-Project---Flicker,代码行数:31,代码来源:CGUIMainMenu.cs


示例14: DrawDefaultMenu

 private void DrawDefaultMenu()
 {
     GUILayout.BeginArea(defaultAreaRect, mainMenuStyle);
     GUILayout.BeginArea(defaultContentRect);
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("继  续", Data.GUI.Button.Medium))
         SwitchGameState();
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("选  项", Data.GUI.Button.Medium))
     {
         stagedState = MenuState.Options;
         Methods.GUI.StageCurrentOptions();
     }
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("关  于", Data.GUI.Button.Medium))
         stagedState = MenuState.About;
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("回到主界面", Data.GUI.Button.Medium))
         stagedState = MenuState.Back;
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("退  出", Data.GUI.Button.Medium))
         stagedState = MenuState.Quit;
     GUILayout.FlexibleSpace();
     GUILayout.EndArea();
     GUILayout.EndArea();
 }
开发者ID:jporter19,项目名称:TeamStyle16_3D,代码行数:26,代码来源:MenuManager.cs


示例15: triggerState

 public void triggerState(MenuState menuState)
 {
     if (GetComponent<UserEntry>() != null)
     {
         if (GetComponent<UserEntry>().getUser() != null)
         {
             if ((menuState == MenuState.create_message))
             {
                 ParseUser user = GetComponent<UserEntry>().getUser();
                 //GetComponent<UserEntry>().setUser(null);
                 EventManager.enterConversation(user);
             }
         }
     }
     if (menuState == MenuState.messages)
     {
         if (!appManager.GetComponent<Messaging>().hasPartners())
         {
             appManager.GetComponent<Messaging>().startFetchPartners();
             appManager.GetComponent<Messaging>().showNoPartnersNotification();
             return;
         }
     }
     if(menuState == MenuState.search)
     {
         if (!appManager.GetComponent<UserManagement>().userHasSufficientProfileInformation())
         {
             appManager.GetComponent<UserManagement>().showProfileInformationNotification();
             menuState = MenuState.profile;
         }
     }
     EventManager.changeMenuState(menuState);
 }
开发者ID:LudusExtremus,项目名称:Trainingspartner-Kraftwerk,代码行数:33,代码来源:TriggerMenuState.cs


示例16: MenuScreen

        public MenuScreen()
        {
            isActive = false;
            isHidden = true;
            canLauchChallenge = false;

            menuSound = SoundEffectLibrary.Get("cursor").CreateInstance();

            m_sprite = new Sprite(Program.TheGame, TextureLibrary.GetSpriteSheet("menu_start_bg"), m_transform);
            m_sprite.Transform.Position = outPos;
            arrow = new Sprite(Program.TheGame, TextureLibrary.GetSpriteSheet("arrow"), new Transform(m_transform, true));

            moveTo = new MoveToStaticAction(Program.TheGame, m_transform, inPos, 1);
            moveTo.StartPosition = new Vector2(80, 200);
            moveTo.Interpolator = new PSmoothstepInterpolation();
            moveTo.Timer.Interval = 0.5f;

            moveOut = new MoveToStaticAction(Program.TheGame, m_transform, outPos, 1);
            moveOut.StartPosition = inPos;
            moveOut.Interpolator = new PSmoothstepInterpolation();
            moveOut.Timer.Interval = 0.5f;

            choice = MenuState.START;
            challengeChoice = ChallengeState.CHALL_1;
        }
开发者ID:TastyWithPasta,项目名称:GameboyJam2013,代码行数:25,代码来源:MenuScreen.cs


示例17: onKeyUp

 private void onKeyUp(object sender, KeyEventArgs e) {
     if (e.KeyCode == Keys.T) {
         if (this.menuState == MenuState.CLOSED) {
             List<GTA.MenuItem> menuItems = new List<GTA.MenuItem>();
             List<string> tnames = Team.getTeamNames();
             tnames.ForEach((string name) => {
                 menuItems.Add(
                     new TeamSpawnerButton(name,
                         Messages.get("app-button-spawn-label", new string[] {name}), this.onTeamSelected
                     )
                 );
             });
             GTA.Menu menu = new GTA.Menu(Messages.get("app-menu-title"), menuItems.ToArray());
             menu.HeaderColor = Color.DarkBlue;
             menu.SelectedItemColor = Color.Aqua;
             menu.FooterColor = Color.White;
             menu.FooterHeight = 5;
             View.AddMenu(menu);
             this.menuState = MenuState.OPEN;
         } else {
             View.CloseAllMenus();
             this.menuState = MenuState.CLOSED;
         }
     } else if (e.KeyCode == Keys.L) {
         UI.Notify(Messages.get("app-notify-config-reload"));
         this.loadConfig();
     }
 }
开发者ID:Andew,项目名称:gta5-mods,代码行数:28,代码来源:CopCallerApp.cs


示例18: GUIMainMenu

    private void GUIMainMenu()
    {
        Rect buttonRect = new Rect(Screen.width / 2 - (buttonWidth / 2), Screen.height * buttonsStart, buttonWidth, buttonHeight);

        playButton = GUI.Button(buttonRect, "Play");
        buttonRect.y += buttonsOffset;
        settingsButton = GUI.Button(buttonRect, "Settings");
        buttonRect.y += buttonsOffset;
        exitButton = GUI.Button(buttonRect, "Exit");

        // Draw a button to start the game
        if (playButton)
        {
            // On Click, load the first level.
            // "Stage1" is the name of the first scene we created.
            Application.LoadLevel("Level1");
        }
        if (settingsButton)
        {
            menuState = MenuState.settings;
        }
        if (exitButton)
        {
            Application.Quit();
        }
    }
开发者ID:ramparter,项目名称:IslandsFF,代码行数:26,代码来源:MainMenuController.cs


示例19: menuStateChanged

 private void menuStateChanged(MenuState menuState)
 {
     if (menuState == MenuState.news)
     {
         StartCoroutine(updateNews());
     }
 }
开发者ID:LudusExtremus,项目名称:Trainingspartner-Kraftwerk,代码行数:7,代码来源:NewsManagement.cs


示例20: Awake

 void Awake()
 {
     screenMap 		   = new Dictionary<MenuState, ScreenState>();
     currentScreen 	   = MenuState.Pause;
     BackgroundRenderer = gameObject.GetComponent<SpriteRenderer>();
     screenMap.Add( MenuState.Pause, new PauseScreen( Skin, BackgroundRenderer, this ) );
     screenMap.Add( MenuState.Instructions, new InstructionScreen( Skin, BackgroundRenderer, this ) );
 }
开发者ID:JamesZinger,项目名称:Axon-TOJam9,代码行数:8,代码来源:PauseMenu.cs



注:本文中的MenuState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MenuType类代码示例发布时间:2022-05-24
下一篇:
C# MenuScreen类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap