fix config creation collisions (#239)

This commit is contained in:
minenice55 2023-01-25 10:28:51 -05:00 committed by GitHub
parent 6a61b9d87a
commit 07b9f8dff1
2 changed files with 12 additions and 2 deletions

View file

@ -171,7 +171,6 @@ namespace HeavenStudio
{
MasterVolume = value;
AudioListener.volume = MasterVolume;
PersistentDataManager.gameSettings.masterVolume = MasterVolume;
}
void OnApplicationQuit()

View file

@ -4,6 +4,7 @@ using UnityEngine.UI;
using TMPro;
using HeavenStudio.Common;
namespace HeavenStudio.Editor
{
public class DispAudioSettings : TabsContent
@ -26,7 +27,6 @@ namespace HeavenStudio.Editor
dropDownData.Add(optionData);
}
resolutionsDropdown.AddOptions(dropDownData);
resolutionsDropdown.value = GlobalGameManager.ScreenSizeIndex;
resolutionsDropdown.onValueChanged.AddListener(delegate
{
@ -46,6 +46,8 @@ namespace HeavenStudio.Editor
heightInputField.text = GlobalGameManager.CustomScreenHeight.ToString();
});
resolutionsDropdown.value = GlobalGameManager.ScreenSizeIndex;
widthInputField.text = GlobalGameManager.CustomScreenWidth.ToString();
heightInputField.text = GlobalGameManager.CustomScreenHeight.ToString();
@ -67,16 +69,25 @@ namespace HeavenStudio.Editor
{
GlobalGameManager.ChangeMasterVolume(volSlider.value);
volLabel.text = System.Math.Round(volSlider.value * 100, 2).ToString();
PersistentDataManager.gameSettings.masterVolume = volSlider.value;
}
public void OnVolLabelChanged()
{
volSlider.value = (float)System.Math.Round(System.Convert.ToSingle(volLabel.text) / 100f, 2);
GlobalGameManager.ChangeMasterVolume(volSlider.value);
PersistentDataManager.gameSettings.masterVolume = volSlider.value;
}
public override void OnOpenTab()
{
resolutionsDropdown.value = GlobalGameManager.ScreenSizeIndex;
widthInputField.text = GlobalGameManager.CustomScreenWidth.ToString();
heightInputField.text = GlobalGameManager.CustomScreenHeight.ToString();
volSlider.value = GlobalGameManager.MasterVolume;
volLabel.text = System.Math.Round(volSlider.value * 100, 2).ToString();
}
public override void OnCloseTab()