Firstborn/Assets/Scripts/CharacterCreationVolume.cs
Schaken-Mods 902e38d0ab Fixed the Color picker and added hairs
The color picker would reset every time you clicked away, - fixed. Added some hairs. I seem to have an issue with them lining up, I will have to fiddle with this.
2023-04-08 02:11:54 -05:00

30 lines
824 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CharacterCreationVolume : MonoBehaviour
{
[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();
ini.Open(iniPath+@"\Settings.ini");
string Value = ini.ReadValue("Sound Settings", "MusicVolume", "1");
Volume.value = float.Parse(Value);
ini.Close();
}
public void SaveVolume() {
INIParser ini = new INIParser();
ini.Open(iniPath+@"\Settings.ini");
ini.WriteValue("Sound Settings", "MusicVolume", Volume.value.ToString());
ini.Close();
}
}