902e38d0ab
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.
30 lines
824 B
C#
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();
|
|
}
|
|
|
|
|
|
}
|