Ejemplo n.º 1
0
    void OnEnable()
    {
        webSocketManager = GetComponent <WebSocketManager>();

        backgroundImage    = background.GetComponent <Image>();
        commandCenterSetup = FindObjectOfType <CommandCenterSetup>();

        CommandCenterSetup.OnMovementSetupEvent += SetUpTurns;
    }
Ejemplo n.º 2
0
 public void GiveTurn(string method)
 {
     turnsLeft -= 1;
     // (turnsLeft+1)/2 to show half the num turns left correctly w/ int division
     totalTurnsDisplay.text  = "Turns Left: " + (turnsLeft + 1) / 2;
     totalTurnsDisplay.color = Color.black;
     if (!commandCenterSetup)
     {
         commandCenterSetup = FindObjectOfType <CommandCenterSetup>();
     }
     if (turnsLeft % 2 == 0) //just switched to human's turn
     {
         theirHandler.GiveTurn();
         myHandler.GetTurn();
         movesRemaining = leadersMovesPerTurn;
         instructionControl.TurnOn();
         backgroundImage.material.SetColor("_Color", gameGreen);
         backgroundImage.material.SetColor("_Color2", gameGreen);
         timeKeeper.ResetTime("Human");
         // commandCenterSetup.ToggleLeaderFollowerView("Human");
     }
     else   //just switched to agent's turn
     {
         myHandler.GiveTurn();
         theirHandler.GetTurn();
         movesRemaining = followersMovesPerTurn;
         instructionControl.TurnOff();
         timeKeeper.ResetTime("Agent");
         backgroundImage.material.SetColor("_Color", gamePink);
         backgroundImage.material.SetColor("_Color2", gamePink);
         // commandCenterSetup.ToggleLeaderFollowerView("Agent");
         instructionControl.DisplayTurnGraphic();
     }
     moveDisplay.text = "Moves: " + movesRemaining + " Moves Left in Turn";
     if (isFirstTurn)
     {
         isFirstTurn = false;
     }
 }