public IEnumerator SetEnemiesTurn() { GetAllEnemies(); for (int i = 0; i < numberEnemies; i++) { // Starts all enemies turn EnemyBaseClass enemyBaseScript = allEnemiesInScene[i].GetComponent <EnemyBaseClass>(); cameraControllerSCR.SnapToPosition(enemyBaseScript.GetPos()); //camera shows enemy actions yield return(new WaitForSeconds(enemyWaitTime)); enemyBaseScript.StartEnemiesTurn(); yield return(new WaitForSeconds(0.01f)); cameraControllerSCR.SnapToPosition(enemyBaseScript.GetPos()); yield return(new WaitForSeconds(enemyWaitTime)); } cameraControllerSCR.SnapToPosition(GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScript>().GetPos()); yield return(new WaitForSeconds(enemyWaitTime)); //Back to players turn PlayerScript.actionsPerTurn = PlayerScript.maxActionsPerTurn; gridManagerSCR.SetCurrentGameState(GridSystemManager.EGameState.EPlayerMove); gridManagerSCR.ChangeTurn(true); gridManagerSCR.IncrPower(1); gridManagerSCR.SetGroundMaterial(); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Totem1")) { gridManager.IncrPower(totemAdd1); Destroy(other.gameObject); } if (other.gameObject.CompareTag("Totem2")) { gridManager.IncrPower(totemAdd2); Destroy(other.gameObject); } if (other.gameObject.CompareTag("Totem3")) { gridManager.IncrPower(totemAdd3); Destroy(other.gameObject); } }