Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
GameSerializationBinder.cs
Go to the documentation of this file.
1using System;
2using Newtonsoft.Json.Serialization;
3using UnityEngine;
4
5public class GameSerializationBinder : DefaultSerializationBinder, ISerializationBinder
6{
8
9 public override Type BindToType(string assemblyName, string typeName)
10 {
11 try
12 {
13 return base.BindToType(assemblyName, typeName);
14 }
15 catch (Exception ex)
16 {
17 Debug.LogError(ex.Message);
18 Debug.LogError(assemblyName + "/" + typeName);
19 if (ModUtil.fallbackTypes.ContainsKey(typeName))
20 {
21 Debug.Log(typeName + "/" + Type.GetType(ModUtil.fallbackTypes[typeName]));
22 return Type.GetType(ModUtil.fallbackTypes[typeName]);
23 }
24 if (typeName.Contains("Quest"))
25 {
26 return typeof(QuestDummy);
27 }
28 return typeof(object);
29 }
30 }
31}
override Type BindToType(string assemblyName, string typeName)
static readonly GameSerializationBinder Instance
static Dictionary< string, string > fallbackTypes
Definition: ModUtil.cs:10