コード例 #1
0
    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]);
    }
コード例 #2
0
    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]);
    }
コード例 #3
0
 private void Start()
 {
     _currentGameSettings = FindObjectOfType <GameStateManager>()?.CurrentGameSettings;
     OnActiveSettingChanged?.Invoke(this, _currentGameSettings?.GameSettings[_activeGameSettingIndex]);
 }