d2c5e0c92c
Worked on the Editor's Actor creator. NPC's can now have custom colored skins and hairs.
42 lines
1.4 KiB
C#
42 lines
1.4 KiB
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;
|
|
[SerializeField] private Slider UIVolume;
|
|
// 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");
|
|
string UIValue = ini.ReadValue("Sound Settings", "UIVolume", "1");
|
|
Volume.value = float.Parse(Value);
|
|
UIVolume.value = float.Parse(UIValue);
|
|
ini.Close();
|
|
}
|
|
|
|
public void SaveVolume() {
|
|
iniPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments)+@"\My Games\Firstborn\";
|
|
INIParser ini = new INIParser();
|
|
ini.Open(iniPath+@"\Settings.ini");
|
|
ini.WriteValue("Sound Settings", "MusicVolume", Volume.value.ToString());
|
|
ini.Close();
|
|
}
|
|
|
|
public void SaveUIVolume() {
|
|
iniPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments)+@"\My Games\Firstborn\";
|
|
INIParser ini = new INIParser();
|
|
ini.Open(iniPath+@"\Settings.ini");
|
|
ini.WriteValue("Sound Settings", "UIVolume", UIVolume.value.ToString());
|
|
ini.Close();
|
|
}
|
|
|
|
|
|
}
|