public void EndTurn() { targetInList = 0; lastActionPress = -1; soldiersInRange.Clear(); focusTeam = false; foreach (Transform el in accRaycastHitIndicatorParent) { el.transform.localPosition = Vector3.zero; } soldiersInRange.Clear(); currentSoldier.SpentTurn(); if (currentSoldier == activeSoldiers[0]) { //int count2 = reactsOnStack.Count - 1; //while (count2 > 0) //{ // if (reactsOnStack[count2].turnsactive != -1) { reactsOnStack.RemoveAt(count2); } // count2--; //} gameManager.EndOfRound(); SortSoldierList(); } else { int count = activeSoldiers.Count - 1; while (count >= 0) { if (activeSoldiers[count].spentTurn == false) { currentSoldier = activeSoldiers[count]; moveRemaining = currentSoldier.SpendMove(0); lastpos = currentSoldier.transform.position; posmark = currentSoldier.transform.position; currentSoldier.Focus(); uiManager.SetTurnList(activeSoldiers); uiManager.SetSoldierDisplayerText(currentSoldier); lookTarget = currentSoldier; cam.GetComponent <ThirdPersonOrbitCam>().player = currentSoldier.transform; actionRemaining = currentSoldier.actionpoints; movepointsText.text = currentSoldier.movepoints.ToString(); actionpointstext.text = currentSoldier.actionpoints.ToString(); return; } count--; } } }