本文整理汇总了C#中System.Switch.getOnOff方法的典型用法代码示例。如果您正苦于以下问题:C# Switch.getOnOff方法的具体用法?C# Switch.getOnOff怎么用?C# Switch.getOnOff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Switch
的用法示例。
在下文中一共展示了Switch.getOnOff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
//.........这里部分代码省略.........
freeze.isSeeable = false;
#region PlayAgainMenu
// title for play again menu
Text playAgain = new Text("Play Again?", font)
{
attributes = new Attributes()
{
color = Color.Black,
depth = 0f,
},
height = 200
};
// button names for play again menu
String[] PAButtonNames = new String[2];
PAButtonNames[0] = "Yes";
PAButtonNames[1] = "No";
// starts new game or goes to main menu depending on choice
Button.ClickHandler[] playAgainAction = new Button.ClickHandler[2];
// if playagain is chosen from the menu, following options are available
playAgainAction[0] = delegate() {
player1.Reset(); player2.Reset(); computer.Reset();
if (speed != null)
{
// switch based on what speed game type is being played
switch (speed.myType)
{
//
// game length?
case Speed.gameType.Timed:
int x = speed.gameLength;
speed = new Speed(cards, background, selector, font, speed.you, speed.opp, textures, speed.myType, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, freeze);
speed.gameLength = x;
break;
//
case Speed.gameType.Marathon:
int y = speed.winningscore;
speed = new Speed(cards, background, selector, font, speed.you, speed.opp, textures, speed.myType, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, freeze);
speed.winningscore = y;
break;
// if neither of the other cases apply, do this default action
default:
speed = new Speed(cards, background, selector, font, speed.you, speed.opp, textures, speed.myType, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, freeze);
break;
}
speed.TurnOn(); PlayAgain.isPaused = true;
}
if (levels != null) {
levels = new Levels(cards, background, selector, font, levels._player1, textures, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, (Levels.Difficulty) DifficultySwitch.getState(), freeze);
levels.StartGame();
PlayAgain.isPaused = true;
}
};
// if exit is chosen, nullifies levels or speed, returns to main menu
playAgainAction[1] = delegate()
{
if (speed != null) speed = null;
if (levels != null) levels = null;
PlayAgain.isPaused = true; MainMenu.isPaused = false;
};
// makes playagain menu
PlayAgain = new Menu(playAgainBackground, 2, playAgain, PAButtonNames, playAgainAction, font, 100, true);