Example #1
0
    //----------------------------------------------------//

    //Turn Management
    public void EndTurn()
    {
        if (endTurnBuffer)
        {
            hourglassControls.SendMessage("PlayerTurnEnded");
            // Debug.Log("I was told to end turn!");
            isTurn = false;
            comboController.enabled = false;
            //Debug.Log("endingturn");
            if (turnManager != null)
            {
                endTurnBuffer = false;
                attackController.allowAttack = false;
                // this.gameObject.GetComponent<BasicRayAttack>().clearTarget();
                turnManager.SendMessage("CalculateTurn");
            }
            else
            {
                Debug.Log("No manager found");
            }
        }
    }
Example #2
0
 void MakeTurn()
 {
     if (currentUnit.tag.Equals("Baddy"))
     {
         // Debug.Log("Current unit is a baddy");
         hourglassControls.pause();
         currentUnit.GetComponent <ZombieAI>().enabled = true;
     }
     else  //current unit is a player
     {
         if (!isCombatEnded())
         {
             hourglassControls.resume();
             hourglassControls.SendMessage("PlayerTurnStart");
             currentUnit.SendMessage("StartTurn");
         }
     }
     cam.SendMessage("SetCameraFollow", currentUnit.gameObject);
 }