// Start is called before the first frame update void Start() { //PlayerPrefs.DeleteAll(); player = parentPlayer.GetComponent <PlayerMenuScript>().playerNum; LoadProfileList.totalNames = LoadProfileList.LoadData(); //loads data and set totalNames to the total amount of names LoadProfileList.MakePages(); LoadProfileList.printNamePages(); Debug.Log("LoadProfileList.totalNames = " + LoadProfileList.totalNames); }
//public PlayerProfile profile; static public void saveProfile(string s) { int totalNames = LoadProfileList.LoadData(); //.getTotalNames(); PlayerPrefs.SetString("name" + totalNames, s); PlayerPrefs.SetInt("AssaultLv" + totalNames, 1); //set to level 1 for now PlayerPrefs.SetInt("HeavyLv" + totalNames, 1); //set to level 1 for now PlayerPrefs.SetInt("ShotgunLv" + totalNames, 1); //set to level 1 for now PlayerPrefs.SetInt("SniperLv" + totalNames, 1); //set to level 1 for now PlayerPrefs.Save(); //Debug.Log("created: name"+totalNames); Debug.Log("Created: name" + totalNames + "\nName" + totalNames + " = " + s + "\nAssault" + totalNames + "Lv = " + 1 + "\nHeavy" + totalNames + "Lv = " + 1 + "\nShotgun" + totalNames + "Lv = " + 1 + "\nSniper" + totalNames + "Lv = " + 1); //PlayerPrefs.SetInt("TotalProfiles", totalNames + 1); //PlayerPrefs.DeleteAll(); }