public void Save <T>(T dataToSave, string path, UnityAction <SaveResult, string> CompleteMethod, bool encrypted) where T : class, new() { byte[] bytes = BinarySerializationUtility.SerializeProperties(dataToSave); if (encrypted) { BinarySerializationUtility.EncryptData(ref bytes); } File.WriteAllBytes(path, bytes); if (CompleteMethod != null) { CompleteMethod(SaveResult.Success, ""); } }
public void Save <T>(T dataToSave, string path, UnityAction <SaveResult, string> CompleteMethod, bool encrypted) where T : class, new() { byte[] bytes = BinarySerializationUtility.SerializeProperties(dataToSave); if (this.encrypted) { BinarySerializationUtility.EncryptData(ref bytes); } string serializedData = ConvertToString(bytes); PlayerPrefs.SetString(path, serializedData); if (CompleteMethod != null) { CompleteMethod(SaveResult.Success, ""); } }