Beispiel #1
0
    public void SetFullScreen(int isFullScreenSelection)
    {
        bool isFullScreen = isFullScreenSelection == 1 ? true : false;

        Screen.fullScreen = isFullScreen ? true : false;
        OptionsPreferencesManager.SetFullScreen(isFullScreen);
    }
Beispiel #2
0
    void Start()
    {
        float volume = OptionsPreferencesManager.GetVolume();

        Debug.Log("initializing Volue to: " + volume);
        InitializeVolume(volume);
    }
Beispiel #3
0
    public void SetVolume(float volume)
    {
        float volumeInDecibels = ConvertToDecibel(volume);

        audioMixer.SetFloat(musicVolumeParam, volumeInDecibels);
        OptionsPreferencesManager.SetVolume(volumeInDecibels);
    }
Beispiel #4
0
    void SetResolution(int resolutionIndex)
    {
        Resolution resolution = resolutions[resolutionIndex];

        Screen.SetResolution(resolution.width, resolution.height, OptionsPreferencesManager.GetFullScreen());
        OptionsPreferencesManager.SetResolution(resolution.width, resolution.height);
    }
Beispiel #5
0
    private void InitializeSensitivity()
    {
        sensitivitySlider.onValueChanged.RemoveAllListeners();
        sensitivitySlider.onValueChanged.AddListener(SetSensitivity);

        sensitivitySlider.value = OptionsPreferencesManager.GetSensitivity();
    }
    private void Awake()
    {
        portalRecursions = OptionsPreferencesManager.GetPortalRecursion();
        mainCamera = Camera.main;

        tempTexture1 = new RenderTexture(Screen.width, Screen.height, renderTextureDepth, RenderTextureFormat.ARGB32);
        tempTexture2 = new RenderTexture(Screen.width, Screen.height, renderTextureDepth, RenderTextureFormat.ARGB32);
    }
Beispiel #7
0
    public void InitializeVolume()
    {
        float volume = OptionsPreferencesManager.GetVolume();

        volumeSlider.onValueChanged.RemoveAllListeners();
        volumeSlider.onValueChanged.AddListener(SetVolume);
        volumeSlider.value = ConvertFromDecibel(volume);
    }
Beispiel #8
0
    public void SetVolume(float volume)
    {
        volumeValue.text = (int)(volume * 100) + "%";

        float volumeInDecibels = ConvertToDecibel(volume);

        audioMixer.SetFloat(musicVolumeParam, volumeInDecibels);
        OptionsPreferencesManager.SetVolume(volumeInDecibels);
    }
Beispiel #9
0
 public void InitializeVolume()
 {
     if (volume == null)
     {
         GameObject newSlider = Instantiate(sliderPrefab, scrollViewContent);
         volume = newSlider.GetComponent <SliderItem>();
     }
     volume.Init("Volume", ConvertFromDecibel(OptionsPreferencesManager.GetVolume()), SetVolume, 0.0001f, 1, false);
     volume.input.text = (int)(ConvertFromDecibel(OptionsPreferencesManager.GetVolume()) * 100) + "%";
 }
Beispiel #10
0
    public void SetCameraFOV(float value)
    {
        int newValue = Mathf.FloorToInt(value);

        cameraFOV.input.text = newValue.ToString();
        OptionsPreferencesManager.SetCameraFOV(newValue);

        if (playerCamera != null)
        {
            playerCamera.fieldOfView = newValue;
        }
    }
Beispiel #11
0
    private void SetupSensitivitySlider()
    {
        if (currentSliderItem == null)
        {
            GameObject sliderObject = Instantiate(sliderPrefab, scrollViewContent);
            currentSliderItem = sliderObject.GetComponent <SliderItem>();
        }

        currentSliderItem.Init(OptionsPreferencesManager.sensitivityKey, OptionsPreferencesManager.GetSensitivity(), SetSensitivity, 0.01f, 1, false);
        string inputText = Mathf.RoundToInt(OptionsPreferencesManager.GetSensitivity() * 100) + "%";

        currentSliderItem.input.text = inputText;
    }
Beispiel #12
0
    public void SetPortalRecursion()
    {
        int newValue = Mathf.FloorToInt(portalRecursionSlider.value);

        portalRecursionText.text = newValue.ToString();
        OptionsPreferencesManager.SetPortalRecursion(newValue);

        // This won't exist in the menu
        if (recursivePortalCamera != null)
        {
            recursivePortalCamera.UpdatePortalRecursion(newValue);
        }
    }
Beispiel #13
0
    public void SetupPortalRecursion()
    {
        portalRecursionSlider.onValueChanged.RemoveAllListeners();
        portalRecursionSlider.onValueChanged.AddListener(delegate
                                                         { SetPortalRecursion(); });
        portalRecursionSlider.value = OptionsPreferencesManager.GetPortalRecursion();

        CameraMove cameraMove = GetComponentInParent <CameraMove>();

        if (cameraMove != null)
        {
            recursivePortalCamera = cameraMove.GetComponentInChildren <RecursivePortalCamera>();
        }
    }
Beispiel #14
0
    public void SetSensitivity(float sensitivity)
    {
        if (playerAiming != null)
        {
            playerAiming.sensitivityMultiplier = sensitivity;
        }

        int percentage = Mathf.RoundToInt(sensitivity * 100);

        currentSliderItem.SetInput(percentage + "%");
        currentSliderItem.SetSliderValue(sensitivity);

        OptionsPreferencesManager.SetSensitivity(sensitivity);
    }
Beispiel #15
0
    public void SetSensitivity(float sensitivity)
    {
        if (playerAiming != null)
        {
            playerAiming.sensitivityMultiplier = sensitivity;
        }

        int percentage = Mathf.RoundToInt(sensitivity * 100);

        sensitivityValue.text   = percentage + "%";
        sensitivitySlider.value = sensitivity;
        Debug.Log("Setting sensitivity to: " + sensitivity);

        OptionsPreferencesManager.SetSensitivity(sensitivity);
    }
Beispiel #16
0
    public void SetupCameraFOV()
    {
        cameraFOVSlider.onValueChanged.RemoveAllListeners();
        cameraFOVSlider.onValueChanged.AddListener(delegate
                                                   { SetCameraFOV(); });

        cameraFOVSlider.value = OptionsPreferencesManager.GetCameraFOV();
        cameraFOVText.text    = OptionsPreferencesManager.GetCameraFOV().ToString();

        CameraMove cameraMove = GetComponentInParent <CameraMove>();

        if (cameraMove != null)
        {
            playerCamera = cameraMove.GetComponentInChildren <Camera>();
        }
    }
Beispiel #17
0
    public void SetupCameraFOV()
    {
        if (cameraFOV == null)
        {
            GameObject newDropdown = Instantiate(sliderItemPrefab, scrollViewContent);
            cameraFOV = newDropdown.GetComponent <SliderItem>();
        }
        cameraFOV.Init("Field Of View", OptionsPreferencesManager.GetCameraFOV(), SetCameraFOV, 60, 130, true);

        CameraMove cameraMove = GetComponentInParent <CameraMove>();

        if (cameraMove != null)
        {
            playerCamera = cameraMove.GetComponentInChildren <Camera>();
        }
    }
Beispiel #18
0
    private int GetStartingResolution()
    {
        int savedHeight     = OptionsPreferencesManager.GetResolutionHeight();
        int savedWidth      = OptionsPreferencesManager.GetResolutionWidth();
        int resolutionIndex = -1;

        for (int i = 0; i < resolutions.Length; i++)
        {
            if (resolutions[i].width == savedWidth &&
                resolutions[i].height == savedHeight)
            {
                resolutionIndex = i;
            }
        }

        // The default (1920 X 1080) wasnt found, return the highest available
        if (resolutionIndex == -1)
        {
            resolutionIndex = resolutions.Length - 1;
        }

        return(resolutionIndex);
    }
Beispiel #19
0
    void Start()
    {
        float volume = OptionsPreferencesManager.GetVolume();

        InitializeVolume(volume);
    }
Beispiel #20
0
 private void Start()
 {
     sensitivityMultiplier    = OptionsPreferencesManager.GetSensitivity();
     playerCamera.fieldOfView = OptionsPreferencesManager.GetCameraFOV();
 }
Beispiel #21
0
 public void SetDefaults()
 {
     OptionsPreferencesManager.SetVolume(OptionsPreferencesManager.defaultVolume);
     volume.slider.value = ConvertFromDecibel(OptionsPreferencesManager.defaultVolume);
 }
Beispiel #22
0
 void awake()
 {
     m_Options = gameObject.GetComponent <OptionsPreferencesManager>() as OptionsPreferencesManager;
 }
Beispiel #23
0
 public void SetQuality(int qualityIndex)
 {
     QualitySettings.SetQualityLevel(qualityIndex);
     OptionsPreferencesManager.SetQuality(qualityIndex);
 }