public void SaveKeyboard() { Debug.Log("Saving.."); BinaryFormatter bf = new BinaryFormatter(); Debug.Log(userName); FileStream file = File.Create(Application.persistentDataPath + "/" + userName + "KeyboardInfo.dat"); KeyboardDataSer keyData = new KeyboardDataSer(); keyData.inputManagerList = new List <InputManager.INPUT_CLASS_FOR_DATA_STORAGE>(); foreach (InputManager.INPUT_CLASS inputClass in InputManager.inputManagerList) { InputManager.INPUT_CLASS_FOR_DATA_STORAGE tempInputClass = new InputManager.INPUT_CLASS_FOR_DATA_STORAGE(inputClass.Input, buttonSer.returnButtonSer(inputClass.Key), inputClass.Type, inputClass.Tag, inputClass.Name); keyData.inputManagerList.Add(tempInputClass); } bf.Serialize(file, keyData); file.Close(); hasSaved = true; Debug.Log("Save Successful!"); }
public void SaveKeyboard() { Debug.Log("Saving.."); BinaryFormatter bf = new BinaryFormatter(); Debug.Log(userName); FileStream file = File.Create(Application.persistentDataPath + "/" + userName + "KeyboardInfo.dat"); KeyboardDataSer keyData = new KeyboardDataSer(); keyData.inputManagerList = new List<InputManager.INPUT_CLASS_FOR_DATA_STORAGE>(); foreach(InputManager.INPUT_CLASS inputClass in InputManager.inputManagerList) { InputManager.INPUT_CLASS_FOR_DATA_STORAGE tempInputClass = new InputManager.INPUT_CLASS_FOR_DATA_STORAGE(inputClass.Input, buttonSer.returnButtonSer(inputClass.Key), inputClass.Type, inputClass.Tag, inputClass.Name); keyData.inputManagerList.Add(tempInputClass); } bf.Serialize(file, keyData); file.Close(); hasSaved = true; Debug.Log("Save Successful!"); }