private void ResetControls() { _selectionStatus = PlayerSelectionStatus.AssigningHunter; _hunterDevice = null; _ghostDevice = null; _hunterAssignmentText.SetActive(true); _ghostAssignmentText.SetActive(false); Events.g.Raise(new PauseGameEvent()); }
IEnumerator ManageAssignment(GameMode gameMode) { yield return(new WaitForSeconds(0.5f)); ResetControls(); while (true) { if (InputManager.ActiveDevice.AnyButton) { InputDevice currDevice = InputManager.ActiveDevice; if (currDevice == _hunterDevice || currDevice == _ghostDevice) { yield return(null); continue; } switch (_selectionStatus) { case PlayerSelectionStatus.AllAssigned: break; case PlayerSelectionStatus.AssigningHunter: Debug.Log("Assigning Hunter: " + currDevice.Name); // TODO: Strip out debugs! _hunterDevice = currDevice; _selectionStatus = PlayerSelectionStatus.AssigningGhost; _hunterAssignmentText.SetActive(false); _ghostAssignmentText.SetActive(true); break; case PlayerSelectionStatus.AssigningGhost: Debug.Log("Assigning Ghost: " + currDevice.Name); _ghostDevice = currDevice; _selectionStatus = PlayerSelectionStatus.AllAssigned; _ghostAssignmentText.SetActive(false); Events.g.Raise(new ResumeGameEvent()); if (_firstAssignment) { Events.g.Raise(new StartGameEvent(gameMode)); _firstAssignment = false; } break; default: break; } } yield return(null); } }