BayatGames / Support

Customer Support, Submit your issues, improvements, recommendation, problems, etc here.
https://support.bayat.io
8 stars 5 forks source link

Problem with SaveGameTypeManager #13

Closed DavidBours closed 5 years ago

DavidBours commented 5 years ago

Hello,

I bought Same game pro but I have a problem with the SaveGameTypeManager. When my project starts and passing in the Initialize method no types are added.

Regards

hasanbayatme commented 5 years ago

Hi.

Do you mean your custom types or the built-in types? Also, how did you make sure it is not being added and there is no type?

Thanks. Best Regards.

DavidBours commented 5 years ago

Hi,

These are the both, the process generate a Reflection Type Load Exception on this line: (Type[] typesFound = AppDomain.CurrentDomain.GetAssemblies().SelectMany(s => s.GetTypes()).Where(p => type.IsAssignableFrom(p) && !p.IsInterface && !p.IsAbstract).ToArray();) on the SaveGameTypeManager.

I found the problem, it's because I used the following parameters for my project: Scripting runtime version: .NET 4.x equivalent Api Compatibility Level: .NET 4.x

I created an other project with the following parameters for my project: Scripting runtime version: .NET 3.5 equivalent Api Compatibility Level: .NET 2.0 Subset

With these parameters, it's works but I must to use .NET 4.x because I used the external DLL with this framework.

Thanks, Regards.

hasanbayatme commented 5 years ago

I think it is trying to get that External DLL which causes this issue, as you have mentioned. So, I have added a new symbol for forcing it to use Manual Type additions. Please use this and let me know if it works.

Instructions

  1. Download the file SaveGameTypeManager.zip
  2. Replace the file at
    Assets/BayatGames/SaveGamePro/Scripts/Serialization
  3. Add this symbol to Scripting Define Symbols:
    SGP_FORCE_MANUAL_TYPES
  4. Let me know if it works 🎉
DavidBours commented 5 years ago

It works now.

Thank you very much.

Regards