Esempio n. 1
0
 private void OnTurnUpdate(int turnNumber, GameRefModel.BoatColors turnColor)
 {
     if (app.networkSyncManager.currentGameState == GameRefModel.GameState.GamePlaying)
     {
         UpdateTurnText();
     }
 }
Esempio n. 2
0
 void PrepairTeamForTurn(int turnNumber, GameRefModel.BoatColors turnColor)
 {
     Debug.Log("this is what was passed through the event " + turnNumber + turnColor);
     InstantiateTimer();
     LoadBomb();
     LoadMine();
 }
Esempio n. 3
0
 private void UpdateTurn()
 {
     currentSyncedTurn      = model.playerTurn;
     currentSyncedTurnColor = (GameRefModel.BoatColors)currentSyncedTurn;
     IncreaseTurnCount();
     if (OnNetworkTurnUpdate != null)
     {
         OnNetworkTurnUpdate(currentSyncedTurn, currentSyncedTurnColor);
     }
 }
Esempio n. 4
0
    public void NextTurn(GameRefModel.BoatColors colorThatEndedTurn)
    {
        int newTurn = (int)colorThatEndedTurn;

        newTurn += 1;
        if (newTurn > 1)
        {
            newTurn = 0;
        }
        app.networkSyncManager.UpdateNetworkedTurn(newTurn);
        app.networkSyncManager.UpdateNetworkedTurnState(GameRefModel.TurnState.Thinking);
    }
Esempio n. 5
0
 public void PlaceBoats(GameObject instantiatedBoat, int positionNumber, GameRefModel.BoatColors instantiateColor)
 {
     if (instantiateColor == GameRefModel.BoatColors.Yellow)
     {
         Vector3 spawnPosition = app.gameRefModel.yellowStartPositions[positionNumber].position;
         instantiatedBoat.transform.position = spawnPosition;
     }
     if (instantiateColor == GameRefModel.BoatColors.Red)
     {
         Vector3 spawnPosition = app.gameRefModel.redStartPositions[positionNumber].position;
         instantiatedBoat.transform.position = spawnPosition;
     }
 }
 private void BoatActiviation(int turnNumber, GameRefModel.BoatColors turnColor)
 {
     if (realtimeView.isOwnedLocallyInHierarchy && app.networkSyncManager.currentGameState == GameRefModel.GameState.GamePlaying)
     {
         if (myTeamColor == turnColor)
         {
             myBoatPlan.SetActive(true);
             myBoatView.turnHighlighter.SetActive(true);
         }
         else
         {
             myBoatPlan.SetActive(false);
             myBoatView.turnHighlighter.SetActive(false);
         }
     }
 }
Esempio n. 7
0
 public void SomeoneLostTheGame(GameRefModel.BoatColors losingColor)
 {
     app.networkSyncManager.UpdateNetworkedGameState(GameRefModel.GameState.GameOver);
 }