private void NextGameSetting(object sender, EventArgs e) { if (_activeGameSettingIndex + 1 > _currentGameSettings.GameSettings.Count - 1) { _activeGameSettingIndex = 0; } else { _activeGameSettingIndex += 1; } OnActiveSettingChanged?.Invoke(this, _currentGameSettings.GameSettings[_activeGameSettingIndex]); }
private void PreviousGameSetting(object sender, EventArgs e) { if (_activeGameSettingIndex - 1 < 0) { _activeGameSettingIndex = _currentGameSettings.GameSettings.Count - 1; } else { _activeGameSettingIndex -= 1; } OnActiveSettingChanged?.Invoke(this, _currentGameSettings.GameSettings[_activeGameSettingIndex]); }
private void Start() { _currentGameSettings = FindObjectOfType <GameStateManager>()?.CurrentGameSettings; OnActiveSettingChanged?.Invoke(this, _currentGameSettings?.GameSettings[_activeGameSettingIndex]); }