实例介绍
odin-serializer:Fast, robust, powerful and extendible .NET serializer built for Unity源码下载
TeamSirenix是为Unity环境定制的一款高性能.NET序列化工具,名为OdinSerializer。它是Odin - Inspector & Serializer中使用的自定义序列化器的开源版本。OdinSerializer在众多游戏中得到应用,并得到了像Asset Store这样的开发者社区的支持。
OdinSerializer与许多流行的序列化库相比,在性能和垃圾分配方面表现出色,同时为Unity使用提供了更优越的功能集。本文档将介绍如何开始使用OdinSerializer,包括如何将其作为序列化库在您自己的项目中使用,以及如何进行定制化修改以适应您的特定需求。
OdinSerializer支持跨平台使用,提供了箱式和JSON格式化器,并且特别支持Unity的结构体、接口、属性、多态性、泛型、字典、循环引用、委托、多维数组等特性,使其成为Unity游戏开发中理想的序列化解决方案。
使用OdinSerializer非常简单,您可以直接从我们的网站下载最新的.commit作为.unitypackage文件,并将其导入您的Unity项目中即可开始使用。如果您希望对OdinSerializer进行更深层次的定制,我们建议您fork仓库,并按照您的需求进行修改。
此外,OdinSerializer还提供了扩展UnityEngine.Object序列化的能力,您可以通过继承OdinSerializer提供的特定UnityEngine.Object派生类型,或手动实现Unity的ISerializationCallbackReceiver接口来达到这一目的。不过,请注意,如果没有安装如Odin Inspector这样的检查器框架,Odin序列化的字段将无法在Unity的检查器窗口中正确渲染。
【实例截图】
【核心代码】
文件清单
└── odin-serializer-8d9fc0bca118d9c6f927ee2fb23330138a99cbf2
├── Build
│ ├── Assets
│ │ ├── Editor
│ │ │ ├── SceneViewBuildButtons.cs
│ │ │ └── SceneViewBuildButtons.cs.meta
│ │ ├── Editor.meta
│ │ ├── Plugins
│ │ │ ├── Sirenix
│ │ │ │ ├── Odin Serializer
│ │ │ │ │ ├── AOT
│ │ │ │ │ │ ├── link.xml
│ │ │ │ │ │ ├── link.xml.meta
│ │ │ │ │ │ ├── OdinSerializer.dll
│ │ │ │ │ │ ├── OdinSerializer.dll.mdb
│ │ │ │ │ │ ├── OdinSerializer.dll.mdb.meta
│ │ │ │ │ │ └── OdinSerializer.dll.meta
│ │ │ │ │ ├── AOT.meta
│ │ │ │ │ ├── EditorOnly
│ │ │ │ │ │ ├── OdinSerializer.dll
│ │ │ │ │ │ ├── OdinSerializer.dll.mdb
│ │ │ │ │ │ ├── OdinSerializer.dll.mdb.meta
│ │ │ │ │ │ ├── OdinSerializer.dll.meta
│ │ │ │ │ │ ├── OdinSerializer.xml
│ │ │ │ │ │ └── OdinSerializer.xml.meta
│ │ │ │ │ ├── EditorOnly.meta
│ │ │ │ │ ├── JIT
│ │ │ │ │ │ ├── OdinSerializer.dll
│ │ │ │ │ │ ├── OdinSerializer.dll.mdb
│ │ │ │ │ │ ├── OdinSerializer.dll.mdb.meta
│ │ │ │ │ │ └── OdinSerializer.dll.meta
│ │ │ │ │ ├── JIT.meta
│ │ │ │ │ ├── License.txt
│ │ │ │ │ ├── License.txt.meta
│ │ │ │ │ ├── Scripts
│ │ │ │ │ │ ├── OdinBuildAutomation.cs
│ │ │ │ │ │ └── OdinBuildAutomation.cs.meta
│ │ │ │ │ ├── Scripts.meta
│ │ │ │ │ ├── Version.txt
│ │ │ │ │ └── Version.txt.meta
│ │ │ │ └── Odin Serializer.meta
│ │ │ └── Sirenix.meta
│ │ └── Plugins.meta
│ └── ProjectSettings
│ ├── AudioManager.asset
│ ├── ClusterInputManager.asset
│ ├── DynamicsManager.asset
│ ├── EditorBuildSettings.asset
│ ├── EditorSettings.asset
│ ├── GraphicsSettings.asset
│ ├── InputManager.asset
│ ├── NavMeshAreas.asset
│ ├── NetworkManager.asset
│ ├── PackageManagerSettings.asset
│ ├── Physics2DSettings.asset
│ ├── PresetManager.asset
│ ├── ProjectSettings.asset
│ ├── ProjectVersion.txt
│ ├── QualitySettings.asset
│ ├── TagManager.asset
│ ├── TimeManager.asset
│ ├── UnityConnectSettings.asset
│ ├── VFXManager.asset
│ └── XRSettings.asset
├── Images
│ ├── BtnDonate.png
│ ├── BtnDownload.png
│ ├── BtnOdinInspector.png
│ ├── BtnTwitter.png
│ ├── buttons.psd
│ ├── ComplexObjectSerializationBenchmark.png
│ ├── DevdogLogo.png
│ ├── GarbageCollectionSerializationBenchmark.png
│ ├── HugeArraysSerializationBenchmark.png
│ ├── LudiqLogo.png
│ ├── OdinSerializerLogo.png
│ ├── ParadoxNotionLogo.png
│ └── SimpleObjectSerializationBenchmark.png
├── Libraries
│ ├── 7Zip
│ │ ├── 7za.exe
│ │ └── LICENSE
│ ├── MSBuild
│ │ ├── 15.0
│ │ │ ├── Bin
│ │ │ │ ├── AssemblyFolders.config
│ │ │ │ ├── FileTracker32.dll
│ │ │ │ ├── FileTracker64.dll
│ │ │ │ ├── Microsoft.Build.Conversion.Core.dll
│ │ │ │ ├── Microsoft.Build.dll
│ │ │ │ ├── Microsoft.Build.Engine.dll
│ │ │ │ ├── Microsoft.Build.Framework.dll
│ │ │ │ ├── Microsoft.Build.Tasks.Core.dll
│ │ │ │ ├── Microsoft.Build.Utilities.Core.dll
│ │ │ │ ├── Microsoft.Common.CrossTargeting.targets
│ │ │ │ ├── Microsoft.Common.CurrentVersion.targets
│ │ │ │ ├── Microsoft.Common.overridetasks
│ │ │ │ ├── Microsoft.Common.targets
│ │ │ │ ├── Microsoft.Common.tasks
│ │ │ │ ├── Microsoft.CSharp.CrossTargeting.targets
│ │ │ │ ├── Microsoft.CSharp.CurrentVersion.targets
│ │ │ │ ├── Microsoft.CSharp.targets
│ │ │ │ ├── Microsoft.Data.Entity.targets
│ │ │ │ ├── Microsoft.NetFramework.CurrentVersion.props
│ │ │ │ ├── Microsoft.NetFramework.CurrentVersion.targets
│ │ │ │ ├── Microsoft.NetFramework.props
│ │ │ │ ├── Microsoft.NetFramework.targets
│ │ │ │ ├── Microsoft.ServiceModel.targets
│ │ │ │ ├── Microsoft.VisualBasic.CrossTargeting.targets
│ │ │ │ ├── Microsoft.VisualBasic.CurrentVersion.targets
│ │ │ │ ├── Microsoft.VisualBasic.targets
│ │ │ │ ├── Microsoft.WinFx.targets
│ │ │ │ ├── Microsoft.WorkflowBuildExtensions.targets
│ │ │ │ ├── Microsoft.Xaml.targets
│ │ │ │ ├── MSBuild.exe
│ │ │ │ ├── MSBuild.exe.config
│ │ │ │ ├── MSBuild.rsp
│ │ │ │ ├── MSBuildTaskHost.exe
│ │ │ │ ├── MSBuildTaskHost.exe.config
│ │ │ │ ├── Roslyn
│ │ │ │ │ ├── csc.exe
│ │ │ │ │ ├── csc.exe.config
│ │ │ │ │ ├── csc.rsp
│ │ │ │ │ ├── csi.exe
│ │ │ │ │ ├── csi.exe.config
│ │ │ │ │ ├── csi.rsp
│ │ │ │ │ ├── Microsoft.Build.Tasks.CodeAnalysis.dll
│ │ │ │ │ ├── Microsoft.CodeAnalysis.CSharp.dll
│ │ │ │ │ ├── Microsoft.CodeAnalysis.CSharp.Scripting.dll
│ │ │ │ │ ├── Microsoft.CodeAnalysis.dll
│ │ │ │ │ ├── Microsoft.CodeAnalysis.Scripting.dll
│ │ │ │ │ ├── Microsoft.CodeAnalysis.VisualBasic.dll
│ │ │ │ │ ├── Microsoft.CSharp.Core.targets
│ │ │ │ │ ├── Microsoft.DiaSymReader.Native.amd64.dll
│ │ │ │ │ ├── Microsoft.DiaSymReader.Native.x86.dll
│ │ │ │ │ ├── Microsoft.VisualBasic.Core.targets
│ │ │ │ │ ├── Microsoft.Win32.Primitives.dll
│ │ │ │ │ ├── System.AppContext.dll
│ │ │ │ │ ├── System.Collections.Immutable.dll
│ │ │ │ │ ├── System.Console.dll
│ │ │ │ │ ├── System.Diagnostics.FileVersionInfo.dll
│ │ │ │ │ ├── System.Diagnostics.Process.dll
│ │ │ │ │ ├── System.Diagnostics.StackTrace.dll
│ │ │ │ │ ├── System.IO.Compression.dll
│ │ │ │ │ ├── System.IO.FileSystem.dll
│ │ │ │ │ ├── System.IO.FileSystem.DriveInfo.dll
│ │ │ │ │ ├── System.IO.FileSystem.Primitives.dll
│ │ │ │ │ ├── System.IO.Pipes.dll
│ │ │ │ │ ├── System.Reflection.Metadata.dll
│ │ │ │ │ ├── System.Security.AccessControl.dll
│ │ │ │ │ ├── System.Security.Claims.dll
│ │ │ │ │ ├── System.Security.Cryptography.Algorithms.dll
│ │ │ │ │ ├── System.Security.Cryptography.Encoding.dll
│ │ │ │ │ ├── System.Security.Cryptography.Primitives.dll
│ │ │ │ │ ├── System.Security.Cryptography.X509Certificates.dll
│ │ │ │ │ ├── System.Security.Principal.Windows.dll
│ │ │ │ │ ├── System.Text.Encoding.CodePages.dll
│ │ │ │ │ ├── System.Threading.Thread.dll
│ │ │ │ │ ├── System.ValueTuple.dll
│ │ │ │ │ ├── System.Xml.ReaderWriter.dll
│ │ │ │ │ ├── System.Xml.XmlDocument.dll
│ │ │ │ │ ├── System.Xml.XPath.dll
│ │ │ │ │ ├── System.Xml.XPath.XDocument.dll
│ │ │ │ │ ├── vbc.exe
│ │ │ │ │ ├── vbc.exe.config
│ │ │ │ │ ├── vbc.rsp
│ │ │ │ │ ├── VBCSCompiler.exe
│ │ │ │ │ └── VBCSCompiler.exe.config
│ │ │ │ ├── System.Collections.Immutable.dll
│ │ │ │ ├── System.Threading.Tasks.Dataflow.dll
│ │ │ │ ├── Tracker.exe
│ │ │ │ ├── Workflow.targets
│ │ │ │ └── Workflow.VisualBasic.targets
│ │ │ ├── Imports
│ │ │ │ └── Microsoft.Common.Props
│ │ │ │ └── ImportBefore
│ │ │ │ └── Microsoft.NuGet.ImportBefore.props
│ │ │ ├── Microsoft.Common.props
│ │ │ ├── Microsoft.Common.Targets
│ │ │ │ └── ImportAfter
│ │ │ │ ├── Microsoft.DotNet.Docker.ImportAfter.targets
│ │ │ │ └── Microsoft.NuGet.ImportAfter.targets
│ │ │ ├── Microsoft.VisualStudioVersion.v15.Common.props
│ │ │ └── SolutionFile
│ │ │ └── ImportAfter
│ │ │ └── Microsoft.NuGet.Solution.ImportAfter.targets
│ │ └── LICENSE
│ ├── NUnit
│ │ ├── LICENSE
│ │ └── nunit.framework.dll
│ ├── PDB2MDB
│ │ ├── LICENSE MS-Pl
│ │ ├── LICENSE.txt
│ │ ├── pdb2mdb.exe
│ │ └── source.txt
│ └── Unity
│ ├── UnityEditor.dll
│ ├── UnityEngine.AnimationModule.dll
│ ├── UnityEngine.CoreModule.dll
│ └── UnityEngine.dll
├── LICENSE
├── OdinSerializer
│ ├── Config
│ │ ├── AssemblyBuildInfo.cs
│ │ └── GlobalSerializationConfig.cs
│ ├── Core
│ │ ├── DataReaderWriters
│ │ │ ├── BaseDataReader.cs
│ │ │ ├── BaseDataReaderWriter.cs
│ │ │ ├── BaseDataWriter.cs
│ │ │ ├── Binary
│ │ │ │ ├── BinaryDataReader.cs
│ │ │ │ ├── BinaryDataWriter.cs
│ │ │ │ └── BinaryEntryType.cs
│ │ │ ├── IDataReader.cs
│ │ │ ├── IDataWriter.cs
│ │ │ ├── Json
│ │ │ │ ├── JsonConfig.cs
│ │ │ │ ├── JsonDataReader.cs
│ │ │ │ ├── JsonDataWriter.cs
│ │ │ │ └── JsonTextReader.cs
│ │ │ └── SerializationNodes
│ │ │ ├── SerializationNode.cs
│ │ │ ├── SerializationNodeDataReader.cs
│ │ │ ├── SerializationNodeDataReaderWriterConfig.cs
│ │ │ └── SerializationNodeDataWriter.cs
│ │ ├── FormatterLocators
│ │ │ ├── ArrayFormatterLocator.cs
│ │ │ ├── DelegateFormatterLocator.cs
│ │ │ ├── FormatterLocator.cs
│ │ │ ├── GenericCollectionFormatterLocator.cs
│ │ │ ├── IFormatterLocator.cs
│ │ │ ├── ISerializableFormatterLocator.cs
│ │ │ ├── SelfFormatterLocator.cs
│ │ │ └── TypeFormatterLocator.cs
│ │ ├── Formatters
│ │ │ ├── ArrayFormatter.cs
│ │ │ ├── ArrayListFormatter.cs
│ │ │ ├── BaseFormatter.cs
│ │ │ ├── DateTimeFormatter.cs
│ │ │ ├── DateTimeOffsetFormatter.cs
│ │ │ ├── DelegateFormatter.cs
│ │ │ ├── DerivedDictionaryFormatter.cs
│ │ │ ├── DictionaryFormatter.cs
│ │ │ ├── DoubleLookupDictionaryFormatter.cs
│ │ │ ├── EasyBaseFormatter.cs
│ │ │ ├── EmittedFormatterAttribute.cs
│ │ │ ├── EmptyTypeFormatter.cs
│ │ │ ├── FormatterEmitter.cs
│ │ │ ├── GenericCollectionFormatter.cs
│ │ │ ├── HashSetFormatter.cs
│ │ │ ├── IFormatter.cs
│ │ │ ├── KeyValuePairFormatter.cs
│ │ │ ├── ListFormatter.cs
│ │ │ ├── MethodInfoFormatter.cs
│ │ │ ├── MinimalBaseFormatter.cs
│ │ │ ├── MultiDimensionalArrayFormatter.cs
│ │ │ ├── NullableFormatter.cs
│ │ │ ├── PrimitiveArrayFormatter.cs
│ │ │ ├── QueueFormatter.cs
│ │ │ ├── ReflectionFormatter.cs
│ │ │ ├── ReflectionOrEmittedBaseFormatter.cs
│ │ │ ├── SelfFormatterFormatter.cs
│ │ │ ├── SerializableFormatter.cs
│ │ │ ├── StackFormatter.cs
│ │ │ ├── TimeSpanFormatter.cs
│ │ │ ├── TypeFormatter.cs
│ │ │ └── VersionFormatter.cs
│ │ ├── Misc
│ │ │ ├── AllowDeserializeInvalidDataAttribute.cs
│ │ │ ├── AlwaysFormatsSelfAttribute.cs
│ │ │ ├── ArchitectureInfo.cs
│ │ │ ├── Buffer.cs
│ │ │ ├── CachedMemoryStream.cs
│ │ │ ├── CustomFormatterAttribute.cs
│ │ │ ├── CustomGenericFormatterAttribute.cs
│ │ │ ├── CustomLogger.cs
│ │ │ ├── CustomSerializationPolicy.cs
│ │ │ ├── DataFormat.cs
│ │ │ ├── DefaultLoggers.cs
│ │ │ ├── DefaultSerializationBinder.cs
│ │ │ ├── DeserializationContext.cs
│ │ │ ├── EmittedAssemblyAttribute.cs
│ │ │ ├── EntryType.cs
│ │ │ ├── ErrorHandlingPolicy.cs
│ │ │ ├── ExcludeDataFromInspectorAttribute.cs
│ │ │ ├── FormatterLocationStep.cs
│ │ │ ├── FormatterUtilities.cs
│ │ │ ├── IAskIfCanFormatTypes.cs
│ │ │ ├── IExternalGuidReferenceResolver.cs
│ │ │ ├── IExternalIndexReferenceResolver.cs
│ │ │ ├── IExternalStringReferenceResolver.cs
│ │ │ ├── ILogger.cs
│ │ │ ├── ISelfFormatter.cs
│ │ │ ├── ISerializationPolicy.cs
│ │ │ ├── LoggingPolicy.cs
│ │ │ ├── NodeInfo.cs
│ │ │ ├── OdinSerializeAttribute.cs
│ │ │ ├── PrefabModification.cs
│ │ │ ├── PrefabModificationType.cs
│ │ │ ├── PreviouslySerializedAsAttribute.cs
│ │ │ ├── ProperBitConverter.cs
│ │ │ ├── RegisterFormatterAttribute.cs
│ │ │ ├── RegisterFormatterLocatorAttribute.cs
│ │ │ ├── SerializationAbortException.cs
│ │ │ ├── SerializationConfig.cs
│ │ │ ├── SerializationContext.cs
│ │ │ ├── SerializationPolicies.cs
│ │ │ ├── SerializationUtility.cs
│ │ │ └── TwoWaySerializationBinder.cs
│ │ └── Serializers
│ │ ├── AnySerializer.cs
│ │ ├── BooleanSerializer.cs
│ │ ├── ByteSerializer.cs
│ │ ├── CharSerializer.cs
│ │ ├── ComplexTypeSerializer.cs
│ │ ├── DecimalSerializer.cs
│ │ ├── DoubleSerializer.cs
│ │ ├── EnumSerializer.cs
│ │ ├── GuidSerializer.cs
│ │ ├── Int16Serializer.cs
│ │ ├── Int32Serializer.cs
│ │ ├── Int64Serializer.cs
│ │ ├── IntPtrSerializer.cs
│ │ ├── SByteSerializer.cs
│ │ ├── Serializer.cs
│ │ ├── SingleSerializer.cs
│ │ ├── StringSerializer.cs
│ │ ├── UInt16Serializer.cs
│ │ ├── UInt32Serializer.cs
│ │ ├── UInt64Serializer.cs
│ │ └── UIntPtrSerializer.cs
│ ├── OdinSerializer.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Unity Integration
│ │ ├── AOTSupportScanner.cs
│ │ ├── AOTSupportUtilities.cs
│ │ ├── DictionaryKeySupport
│ │ │ ├── BaseDictionaryKeyPathProvider.cs
│ │ │ ├── DictionaryKeyUtility.cs
│ │ │ ├── IDictionaryKeyPathProvider.cs
│ │ │ ├── RegisterDictionaryKeyPathProviderAttribute.cs
│ │ │ ├── Vector2DictionaryKeyPathProvider.cs
│ │ │ ├── Vector3DictionaryKeyPathProvider.cs
│ │ │ └── Vector4DictionaryKeyPathProvider.cs
│ │ ├── Formatters
│ │ │ ├── AnimationCurveFormatter.cs
│ │ │ ├── BoundsFormatter.cs
│ │ │ ├── Color32Formatter.cs
│ │ │ ├── ColorBlockFormatter.cs
│ │ │ ├── ColorFormatter.cs
│ │ │ ├── CoroutineFormatter.cs
│ │ │ ├── GradientAlphaKeyFormatter.cs
│ │ │ ├── GradientColorKeyFormatter.cs
│ │ │ ├── GradientFormatter.cs
│ │ │ ├── KeyframeFormatter.cs
│ │ │ ├── LayerMaskFormatter.cs
│ │ │ ├── QuaternionFormatter.cs
│ │ │ ├── RectFormatter.cs
│ │ │ ├── UnityEventFormatter.cs
│ │ │ ├── Vector2Formatter.cs
│ │ │ ├── Vector3Formatter.cs
│ │ │ ├── Vector4Formatter.cs
│ │ │ └── VectorIntFormatters.cs
│ │ ├── OdinPrefabSerializationEditorUtility.cs
│ │ ├── SerializedUnityObjects
│ │ │ ├── IOverridesSerializationFormat.cs
│ │ │ ├── IOverridesSerializationPolicy.cs
│ │ │ ├── ISupportsPrefabSerialization.cs
│ │ │ ├── SerializationData.cs
│ │ │ ├── SerializedBehaviour.cs
│ │ │ ├── SerializedComponent.cs
│ │ │ ├── SerializedMonoBehaviour.cs
│ │ │ ├── SerializedScriptableObject.cs
│ │ │ ├── SerializedStateMachineBehaviour.cs
│ │ │ └── SerializedUnityObject.cs
│ │ ├── UnityReferenceResolver.cs
│ │ ├── UnitySerializationInitializer.cs
│ │ └── UnitySerializationUtility.cs
│ └── Utilities
│ ├── Extensions
│ │ ├── FieldInfoExtensions.cs
│ │ ├── GarbageFreeIterators.cs
│ │ ├── LinqExtensions.cs
│ │ ├── MemberInfoExtensions.cs
│ │ ├── MethodInfoExtensions.cs
│ │ ├── Operator.cs
│ │ ├── PathUtilities.cs
│ │ ├── PropertyInfoExtensions.cs
│ │ ├── StringExtensions.cs
│ │ ├── TypeExtensions.cs
│ │ └── UnityExtensions.cs
│ └── Misc
│ ├── AssemblyImportSettingsUtilities.cs
│ ├── Cache.cs
│ ├── DoubleLookupDictionary.cs
│ ├── EmitUtilities.cs
│ ├── FastTypeComparer.cs
│ ├── Flags.cs
│ ├── ICacheNotificationReceiver.cs
│ ├── ImmutableList.cs
│ ├── MemberAliasFieldInfo.cs
│ ├── MemberAliasMethodInfo.cs
│ ├── MemberAliasPropertyInfo.cs
│ ├── ReferenceEqualityComparer.cs
│ ├── UnityVersion.cs
│ └── UnsafeUtilities.cs
├── OdinSerializer.sln
└── README.md
48 directories, 362 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论