private void SelectAlly() { allySelectionEffectController.SelectingOneTarget(indexOfAllyList[indexOfAlly]); if (Input.GetKeyDown(KeyCode.UpArrow)) { if (indexOfAlly == 0) { indexOfAlly = 0; // currentAllyList.Count-1; } else { indexOfAlly -= 1; } } else if (Input.GetKeyDown(KeyCode.DownArrow)) { if (indexOfAlly == currentAllyList.Count - 1) { indexOfAlly = currentAllyList.Count - 1; // 0; } else { indexOfAlly += 1; } } if (Input.GetKeyDown(KeyCode.Z)) { // store selected ally from the index selectedAlly = currentAllyList[indexOfAlly]; // remove selected ally from allyList currentAllyList.RemoveAt(indexOfAlly); // add selected and stored ally into selectedAllyList for further function or add action respectively selectedAllyList.Add(selectedAlly); currentState = SelectionState.ACTION; indexOfAllyList.RemoveAt(indexOfAlly); indexOfAlly = 0; // off indicator allySelectionEffectController.SelectingOneTarget(-1); // debug Debug.Log("Selected Ally: " + selectedAlly.GetName()); } }