本文整理汇总了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();
}
示例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
}
示例3: Start
void Start () {
selected = Buttons.newGame;
oldVal = selected;
highlightSelected (selected);
mousedOver = false;
ms = GameObject.Find ("Game Controller").GetComponent<MenuState>();
}
示例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);
}
}
示例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);
}
示例6: Menu
public Menu(Screen screen, Mouse mouse)
{
_screen = screen;
_mouse = mouse;
_subjectBarStatus = MenuState.MENU_CLOSED;
_objectBarStatus = MenuState.MENU_CLOSED;
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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();
}
示例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);
}