2023-04-04 20:56:33 -04:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
public class CharacterCreationVolume : MonoBehaviour
|
|
|
|
{
|
2023-04-08 03:11:54 -04:00
|
|
|
[SerializeField] private string iniPath;
|
|
|
|
[SerializeField] private Slider Volume;
|
|
|
|
// Start is called before the first frame update
|
|
|
|
void OnEnable()
|
|
|
|
{
|
|
|
|
iniPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments)+@"\My Games\Firstborn\";
|
|
|
|
INIParser ini = new INIParser();
|
2023-04-04 20:56:33 -04:00
|
|
|
ini.Open(iniPath+@"\Settings.ini");
|
|
|
|
string Value = ini.ReadValue("Sound Settings", "MusicVolume", "1");
|
2023-04-08 03:11:54 -04:00
|
|
|
Volume.value = float.Parse(Value);
|
2023-04-04 20:56:33 -04:00
|
|
|
ini.Close();
|
2023-04-08 03:11:54 -04:00
|
|
|
}
|
2023-04-04 20:56:33 -04:00
|
|
|
|
2023-04-08 03:11:54 -04:00
|
|
|
public void SaveVolume() {
|
|
|
|
INIParser ini = new INIParser();
|
2023-04-04 20:56:33 -04:00
|
|
|
ini.Open(iniPath+@"\Settings.ini");
|
2023-04-08 03:11:54 -04:00
|
|
|
ini.WriteValue("Sound Settings", "MusicVolume", Volume.value.ToString());
|
2023-04-04 20:56:33 -04:00
|
|
|
ini.Close();
|
2023-04-08 03:11:54 -04:00
|
|
|
}
|
2023-04-04 20:56:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
}
|