private void SetFoVListener() { if (_dialog == null) { return; } if (_dialogButtons == null) { _dialogButtons = _dialog.GetComponentsInChildren <Button>(true); } _dialogButtons[5].onClick.AddListener(new UnityAction(OnFoVChange)); Slider fovSlider = _dialog.GetComponentInChildren <Slider>(true); fovSlider.onValueChanged.AddListener(new UnityAction <float>(OnFoVChange)); if (_currentFoV > 0) { if (_currentFoV < _currentMinFoV) { _currentFoV = _currentMinFoV; } if (_currentFoV > _currentMaxFoV) { _currentFoV = _currentMaxFoV; } _dialog.fovCurrent = _currentFoV; if (fovSlider != null) { fovSlider.value = _currentFoV; } } }