当前位置: 首页>>代码示例>>C#>>正文


C# MenuState类代码示例

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


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


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