Files
Dec2017-Script-Dump/UnityEngine/Serialization/UnitySurrogateSelector.cs
T
2026-06-04 11:42:34 +02:00

45 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace UnityEngine.Serialization
{
// Token: 0x020004ED RID: 1261
public class UnitySurrogateSelector : ISurrogateSelector
{
// Token: 0x06003C29 RID: 15401 RVA: 0x00069EA8 File Offset: 0x000680A8
public ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
{
if (type.IsGenericType)
{
Type genericTypeDefinition = type.GetGenericTypeDefinition();
if (genericTypeDefinition == typeof(List<>))
{
selector = this;
return ListSerializationSurrogate.Default;
}
if (genericTypeDefinition == typeof(Dictionary<, >))
{
selector = this;
Type type2 = typeof(DictionarySerializationSurrogate<, >).MakeGenericType(type.GetGenericArguments());
return (ISerializationSurrogate)Activator.CreateInstance(type2);
}
}
selector = null;
return null;
}
// Token: 0x06003C2A RID: 15402 RVA: 0x00069F30 File Offset: 0x00068130
public void ChainSelector(ISurrogateSelector selector)
{
throw new NotImplementedException();
}
// Token: 0x06003C2B RID: 15403 RVA: 0x00069F38 File Offset: 0x00068138
public ISurrogateSelector GetNextSelector()
{
throw new NotImplementedException();
}
}
}