public void CallSave() { theDB = FindObjectOfType <DataOfThisApplication>(); PlayerPrefs.SetInt("Money", theDB.Money); PlayerPrefs.SetInt("highScore", theDB.highScore); PlayerPrefs.SetFloat("MagneticMaxTime", theDB.MagneticMaxTime); PlayerPrefs.SetFloat("MagneticPower", theDB.MagneticPower); PlayerPrefs.SetFloat("SpeedMaxTime", theDB.SpeedMaxTime); PlayerPrefs.SetFloat("SpeedPower", theDB.SpeedPower); PlayerPrefs.SetFloat("minSpeed", theDB.minSpeed); PlayerPrefs.SetFloat("maxHealth", theDB.maxHealth); PlayerPrefs.SetFloat("maxSledHealth", theDB.maxSledHealth); PlayerPrefs.SetFloat("efSoundVolume", theDB.efSoundVolume); PlayerPrefs.SetFloat("BgSoundVolume", theDB.BgSoundVolume); PlayerPrefs.SetInt("UpValue_Speed", theDB.UpValue_Speed); PlayerPrefs.SetInt("UpValue_Hp", theDB.UpValue_Hp); PlayerPrefs.SetInt("UpValue_Mag_Time", theDB.UpValue_Mag_Time); PlayerPrefs.SetInt("UpValue_Spd_Time", theDB.UpValue_Spd_Time); }
public void CallLoad() { theDB = FindObjectOfType <DataOfThisApplication>(); if (PlayerPrefs.HasKey("Money")) { theDB.Money = PlayerPrefs.GetInt("Money"); theDB.highScore = PlayerPrefs.GetInt("highScore"); theDB.MagneticMaxTime = PlayerPrefs.GetFloat("MagneticMaxTime"); theDB.MagneticPower = PlayerPrefs.GetFloat("MagneticPower"); theDB.SpeedMaxTime = PlayerPrefs.GetFloat("SpeedMaxTime"); theDB.SpeedPower = PlayerPrefs.GetFloat("SpeedPower"); theDB.minSpeed = PlayerPrefs.GetFloat("minSpeed"); theDB.maxHealth = PlayerPrefs.GetFloat("maxHealth"); theDB.maxSledHealth = PlayerPrefs.GetFloat("maxSledHealth"); theDB.efSoundVolume = PlayerPrefs.GetFloat("efSoundVolume"); theDB.BgSoundVolume = PlayerPrefs.GetFloat("BgSoundVolume"); theDB.UpValue_Speed = PlayerPrefs.GetInt("UpValue_Speed"); theDB.UpValue_Hp = PlayerPrefs.GetInt("UpValue_Hp"); theDB.UpValue_Mag_Time = PlayerPrefs.GetInt("UpValue_Mag_Time"); theDB.UpValue_Spd_Time = PlayerPrefs.GetInt("UpValue_Spd_Time"); } }
void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; ads = GetComponent <AD>(); } else { DestroyObject(gameObject); } highScore = 0; }