本文整理汇总了C#中GameMode类的典型用法代码示例。如果您正苦于以下问题:C# GameMode类的具体用法?C# GameMode怎么用?C# GameMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameMode类属于命名空间,在下文中一共展示了GameMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
k = 0;
currentWaveTanksNumber = 5;
spawnPoint = GameObject.Find("SpawnPoint").GetComponent<Transform>();
gameModeScript = GameObject.Find("ManagerScripts").GetComponent<GameMode>();
}
示例2: Start
void Start () {
if (gameModeIndexSet) {
gameMode = (GameMode)gameModeIndex;
}
if (gameMode == GameMode.Regular) {
GetComponent<Clock>().StartClock();
}
Board.SetPositionFromFen (Definitions.gameStartFen,true);
ZobristKey.Init ();
Evaluation.Init ();
if (regenerateOpeningBook) {
OpeningBookGenerator.GenerateBook ();
}
if (useOpeningBook) {
OpeningBookReader.Init ();
}
playerManager = GetComponent<MoveManager> ();
playerManager.CreatePlayers ();
Board.SetPositionFromFen (Definitions.gameStartFen,true);
}
示例3: Initialize
public void Initialize()
{
inGame = new InGame();
inGame.Initialize();
gameMode = GameMode.InGameState;
}
示例4: Start
public void Start(GameMode gameMode)
{
int playercount = GtaPlayer.All.Count;
bool success = true;
GtaPlayer player = GtaPlayer.Create(499);
if (GtaPlayer.All.Count - 1 != playercount)
{
Console.WriteLine("DisposureTest: Adding didn't add player to pool.");
success = false;
}
player.Dispose();
if (GtaPlayer.All.Count != playercount)
{
Console.WriteLine("DisposureTest: Disposing didn't remove player from pool.");
success = false;
}
try
{
player.SetChatBubble("Test!", Color.Yellow, 100, 10);
Console.WriteLine("DisposureTest: Passed SetChatBubble.");
success = false;
}
catch (ObjectDisposedException)
{
Console.WriteLine("DisposureTest: Exception thrown.");
}
Console.WriteLine("DisposureTest successful: {0}", success);
}
示例5: Start
public void Start(GameMode gameMode)
{
Native.RegisterExtension(new TestExtension());
Console.WriteLine("Call OnTest183()");
new NativeFunction("CallLocalFunction", typeof (string), typeof (string)).Invoke("OnTest183", "");
}
示例6: EndTurn
void EndTurn()
{
var intGameMode = (int) GameMode;
intGameMode++;
GameMode = (GameMode) (intGameMode % Enum.GetNames(typeof (GameMode)).Length);
}
示例7: ServerResult
/// <summary>
/// Initializes a new instance of the <see cref="ServerResult" /> class.
/// </summary>
/// <param name="level">The level this server is running.</param>
/// <param name="gameMode">The game mode this server is running.</param>
/// <param name="gamePreset">The game preset this server is running.</param>
/// <param name="url">The URL to the server on BattleLog.</param>
public ServerResult(GameLevel level, GameMode gameMode, GamePreset gamePreset, string url)
{
Level = level;
GameMode = gameMode;
GamePreset = gamePreset;
Url = url;
}
示例8: PlayerItem
public PlayerItem(Guid uuid, string name, GameMode mode, int ping)
{
this.UUID = uuid;
this.Name = name;
this.Gamemode = mode;
this.Ping = ping;
}
示例9: Arena
/**
* Constructor
*/
public Arena(Game g, GameMode mode)
: base(g)
{
this.mode = mode;
Init();
bounds = new Rectangle(0, 0, (int)Constants.GAME_WORLD_WIDTH, (int)Constants.GAME_WORLD_HEIGHT);
this.scale = (float)Constants.GAME_WORLD_WIDTH / (float)background.index.Width;
player1.LoadContent();
background = game.getSprite("clouds");
maxLeft = game.maxLeft;
maxRight = game.maxRight;
maxTop = game.maxTop;
maxButtom = game.maxButtom;
gui = new GUI(g);
buttons = new Button[g.blockCounter-9];
int bCounter = 0;
foreach (String i in g.blockList)
{
Button b ;
if(bCounter%3==0)
b = new Button(g, new Vector2(10, (5 + 50 * bCounter)/3), bCounter, i);
else if(bCounter%3==1)
b = new Button(g, new Vector2(50, (5 + 50 * (bCounter-1))/3), bCounter, i);
else
b = new Button(g, new Vector2(90, (5 + 50 * (bCounter - 2)) / 3), bCounter, i);
//gamaddEntity(b);
buttons[bCounter] = b;
bCounter++;
}
deathBall = game.getSprite("deathBall");
}
示例10: ResetLevel
public static void ResetLevel()
{
mode = GameMode.Pause;
previousGameMode = GameMode.Chase;
gameModeTimer = 0.0f;
}
示例11: Apply
public void Apply(GameModeManagerDef _def)
{
if (_def.mode != null)
{
if ( ! _def.mode.overrideMode)
{
if (mode != null || m_ModeToSet != null)
{
Debug.Log("Mode is already exist. ");
}
}
m_ModeToSet = _def.mode;
CancelInvoke("SetupProc");
if (setupDelay <= 0f)
{
Debug.LogWarning("Setup mode without delay. Sure?");
SetupProc();
}
else
{
Invoke("SetupProc", setupDelay);
}
}
}
示例12: ScoreDTO
public ScoreDTO(int player_id, int score, Difficulty difficulty, GameMode game_mode)
{
this.player_id = player_id;
this.score = score;
this.difficulty = difficulty;
this.game_mode = game_mode;
}
示例13: UploadScoreToServer
public static void UploadScoreToServer(string name, UInt32 score, GameMode gameMode, string levelName)
{
if (name.Length != 3) return;
try
{
ScoreGameType gameType = gameTypeLookup[gameMode];
ScoreLevel level = levelLookup[levelName];
byte[] buffer = new byte[9];
new ASCIIEncoding().GetBytes(name).CopyTo(buffer, 0);
// Convert score to bytes
buffer[3] = (byte)((score & 0xFF000000) >> 24);
buffer[4] = (byte)((score & 0x00FF0000) >> 16);
buffer[5] = (byte)((score & 0x0000FF00) >> 8);
buffer[6] = (byte)((score & 0x000000FF) >> 0);
buffer[7] = (byte)gameType;
buffer[8] = (byte)level;
Coroutiner.StartCoroutine(SendData(GetEncryptedBytes(buffer)));
}
catch (Exception) { Debug.Log("Error uploading score to server"); }
}
示例14: CheckForGameStart
private void CheckForGameStart()
{
if(m_gameMode == GameMode.ReadyUp && m_playerReady[0] && m_playerReady[1])
{
m_gameMode = GameMode.Play;
}
}
示例15: changeModeToGameover
public void changeModeToGameover()
{
gmode = GameMode.GAMEOVER;
gameoverText.gameObject.active = true;
touchtostartText.gameObject.active = true;
ShipInstance.gameObject.active = false;
}