Beispiel #1
0
 public void SetGameMode(GameModes mode)
 {
     if (_gameMode == mode)
     {
         return;
     }
     _gameMode = mode;
     OnGameModeChanged(emptyArgs);
     Debug.Log("Game mode changed to: " + mode.ToString());
 }
Beispiel #2
0
    void OnEnable()
    {
        if (PlayerPrefs.HasKey(mode.ToString()))
        {
            gameObject.SetActive(false);
            showingTut = false;
            return;
        }

        showingTut = true;

        inGameText.gameObject.SetActive(true);
        endGameText.gameObject.SetActive(false);
        tapToPlayText.gameObject.SetActive(false);
        inGameText.text = mechanicsText;

        gm.OnGameStart     += GameStarted;
        gm.OnPushBall      += PushedBall;
        gm.OnDeathBeforeAd += GameEnded;
        gm.OnGameRevive    += Revive;
        gm.OnGameEnd       += GameEnded;
    }
Beispiel #3
0
 public void ToggleThroughGameModes()
 {
     if (_gameMode == GameModes.INFINITE)
     {
         _gameMode = GameModes.LIMITED;
     }
     else
     {
         _gameMode = GameModes.INFINITE;
     }
     OnGameModeChanged(emptyArgs);
     Debug.Log("Game mode changed to: " + _gameMode.ToString());
 }
Beispiel #4
0
 // methods
 // public void V_PlayerTemplate()
 // {
 //     players = new List<V_PlayerTemplate>();
 // }
 public void Form(ref WWWForm form)
 {
     form.AddField("hasAnActiveGame", hasAnActiveGame.ToString());
     form.AddField("roomName", roomName);
     form.AddField("ID", ID.ToString());
     form.AddField("map", map.ToString());
     form.AddField("playerMode", playerMode.ToString());
     form.AddField("gameMode", gameMode.ToString());
     form.AddField("objectives", objectives.ToString());
     form.AddField("password", password);
     form.AddField("weaponFilter", weaponFilter.ToString());
     form.AddField("gameTime", gameTime.ToString());
     form.AddField("autoTeamSelection", autoTeamSelection.ToString());
 }
Beispiel #5
0
        /// <summary>
        /// Changes given Node's Game Mode
        /// </summary>
        /// <param name="_nodeID">Node ID Value</param>
        /// <param name="mode">Game Mode Value</param>
        /// <returns></returns>
        public GameModes ChangeGameMode(int _nodeID, GameModes mode)
        {
            switchMode = true;

            if (node[_nodeID].type == ComModes.canBus)
            {
                int nodeAddress = Convert.ToInt32(this.node[_nodeID].address);   //Get Address
                cb.ChangeGameMode(nodeAddress, mode);
                Thread.Sleep(10);
            }

            node[_nodeID].gameMode = mode.ToString();
            return(mode);
        }
Beispiel #6
0
        /// <summary>
        /// Changes Game Mode on all Nodes
        /// </summary>
        /// <param name="mode">Game Mode Value</param>
        /// <returns></returns>
        public GameModes ChangeGameMode(GameModes mode)
        {
            switchMode = true;

            foreach (Nodes nd in node)
            {
                node[nd.id].gameMode = mode.ToString();
            }

            if (canbusPresent)
            {
                cb.ChangeGameMode(0, mode);
                Thread.Sleep(10);
            }

            return(mode);
        }
Beispiel #7
0
 void SetGameModeText()
 {
     _gameModeText.text = string.Format("Game Mode: {0}", _currentGameMode.ToString());
 }
Beispiel #8
0
 private void GameOnGameStateChangeEvent(GameModes mode)
 {
     _serverState = mode;
     Write(mode.ToString(), Color.Aqua);
 }