so i have a script that has veriable called intel and i want it to save but its not saving
any ideas im using the PlayerPrefs.Save(); in the update and in the late update but when i force stop it in the anrdoid and run it again the verables arnt there anymore
//this is the veriable i want to save
static var intel:float=1;
static var brains:float=0;
////////////////skill timers////////////////////////////////
var skillPlusSpeedTimer : float = 0.0;
var skillFreezeHumanTimer : float = 0.0;
var skillInfectHumansTimer : float = 0.0;
static var skillInfectHumansToggle : boolean = false;
//////////////////////////////////////////////////////////////////////////////////////
function Awake(){
//brains=brainsstat;
PlayerPrefs.GetFloat("brains", brains);
PlayerPrefs.GetFloat("intel", intel);
}
function Update () {
decreasehealth();
//PlayerPrefs.SetFloat("brains", brains);
//PlayerPrefs.SetFloat("intel", intel);
////////////////// adding time to skill timers///////////////
// add time to counter
// use myCounter++; (same as myCounter+=1;) to count the frames - or
skillPlusSpeedTimer += Time.deltaTime; //
skillFreezeHumanTimer += Time.deltaTime; //
skillInfectHumansTimer += Time.deltaTime; //
PlayerPrefs.Save();
}
private var skillsFirstButton :boolean = true;
private var skillsFirstButton2 :boolean = true;}
↧