[SOLVED!] PlayerPrefabs SetFloat and GetFloat is not working
In this code PlayerPrefabs.Setflaot and is PlayerPrefabs.GetFloat not working:
using UnityEngine;
using System.Collections;
using UnityEngine.Audio;
public class AudioMix : MonoBehaviour
{
public AudioMixer masterMixer;
public float musicVolLvl = 0;
void Start()
{
PlayerPrefs.GetFloat("MusicVolume", musicVolLvl);
SetMusicLvl(musicVolLvl);
}
public void SetMusicLvl(float musicLvl)
{
masterMixer.SetFloat ("MusicVolume", musicLvl);
musicVolLvl = musicLvl;
PlayerPrefs.SetFloat("MusicVolume", musicVolLvl);
PlayerPrefs.Save();
}
}
Comment