fix playerprefs usage + rename audiobundles
This commit is contained in:
@@ -27,7 +27,6 @@ public class HomeWorld_Initialize : MonoBehaviour
|
||||
public AssetBundle AudioBundle;
|
||||
public RectTransform SettingsPanel;
|
||||
private Resolution GameResolutionPre;
|
||||
public Toggle FullscreenToggle;
|
||||
public Toggle PostProcessingToggle;
|
||||
public SettingsPanel SettingsPanelScript;
|
||||
|
||||
@@ -59,16 +58,6 @@ public class HomeWorld_Initialize : MonoBehaviour
|
||||
}
|
||||
}*/
|
||||
|
||||
if (PlayerPrefs.HasKey("FullscreenState") && FullscreenToggle)
|
||||
{
|
||||
if (PlayerPrefs.GetInt("FullscreenState") == 1)
|
||||
{
|
||||
FullscreenToggle.isOn = true;
|
||||
} else
|
||||
{
|
||||
FullscreenToggle.isOn = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (PlayerPrefs.GetInt("PostProcessingEnabled") == 1)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SettingsPanel : MonoBehaviour
|
||||
{
|
||||
@@ -9,6 +10,7 @@ public class SettingsPanel : MonoBehaviour
|
||||
public GameObject settingsPanelDeactivator;
|
||||
public bool DisableSettingsPanelWhenLinkedGameobjectIsActivated = false;
|
||||
public TMP_Dropdown GraphicsQualityDropdown;
|
||||
public Toggle FullscreenToggle;
|
||||
public PostProcessVolume PostProcessVolume;
|
||||
public List<PostProcessVolume> PostProcessingVolumes = new() { };
|
||||
|
||||
@@ -44,7 +46,19 @@ public class SettingsPanel : MonoBehaviour
|
||||
}
|
||||
|
||||
GraphicsQualityDropdown.AddOptions(Options);
|
||||
GraphicsQualityDropdown.value = QualitySettings.GetQualityLevel();
|
||||
if (!PlayerPrefs.HasKey("QualityLevel"))
|
||||
GraphicsQualityDropdown.value = QualitySettings.GetQualityLevel();
|
||||
else
|
||||
{
|
||||
QualitySettings.SetQualityLevel(PlayerPrefs.GetInt("QualityLevel"));
|
||||
GraphicsQualityDropdown.value = PlayerPrefs.GetInt("QualityLevel");
|
||||
}
|
||||
|
||||
|
||||
if (PlayerPrefs.HasKey("FullscreenState") && FullscreenToggle)
|
||||
{
|
||||
FullscreenToggle.isOn = bool.Parse(PlayerPrefs.GetString("FullscreenState"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +66,7 @@ public class SettingsPanel : MonoBehaviour
|
||||
{
|
||||
if (GraphicsQualityDropdown)
|
||||
{
|
||||
PlayerPrefs.SetInt("QualityLevel", index);
|
||||
QualitySettings.SetQualityLevel(index);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user