public void ExecuteControllerInputType() { // only call this option once if (optionConfirmed == false) { optionConfirmed = true; for (int i = 0; i < controllerInputOptions.Length; i++) { // if the only active option is active then set those controller type(s) GameObject controllerOption = controllerInputOptions[i]; if (controllerOption.activeSelf == true && controllerMenuParent.activeSelf == true) { ControllerDeviceOption controllerDevice = controllerOption.GetComponent <ControllerDeviceOption>(); controllerDevice.OnChosenInputDevice.Invoke(); break; } // create a instance where the game defaults to 2 player controllers when no option is selected if (i == controllerInputOptions.Length - 1 && controllerMenuParent.activeSelf == false) { SetControllersToTwoPlayerControllers(); } } } }
public void ExecuteControllerInputType() { // only call this option once if (optionConfirmed == false) { optionConfirmed = true; foreach (GameObject controllerOption in controllerInputOptions) { // if the only active option is active then set those controller type(s) if (controllerOption.activeSelf == true) { ControllerDeviceOption controllerDevice = controllerOption.GetComponent <ControllerDeviceOption>(); controllerDevice.OnChosenInputDevice.Invoke(); break; } } } }