コード例 #1
0
 static MyObjectBuilderSerializer()
 {
     Serializer = TypeModel.Create();
     Serializer.AutoAddMissingTypes     = true;
     Serializer.UseImplicitZeroDefaults = false;
     m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
 }
コード例 #2
0
        public static void UnregisterAssembliesAndSerializers()
        {
            m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
#if !XB1                                     // XB1_NOPROTOBUF
            Serializer = TypeModel.Create(); // create empty protobuf serializer
            Serializer.AutoAddMissingTypes     = true;
            Serializer.UseImplicitZeroDefaults = false;
#endif // !XB1
        }
コード例 #3
0
        static MyObjectBuilderSerializer()
        {
#if !XB1 // XB1_NOPROTOBUF
            Serializer = TypeModel.Create();
            Serializer.AutoAddMissingTypes     = true;
            Serializer.UseImplicitZeroDefaults = false;
#endif // !XB1
            m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
        }
コード例 #4
0
 public static void UnregisterAssembliesAndSerializers()
 {
     m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();
     // -------------------------
     m_serializersByType.Clear();
     m_serializersBySerializedName.Clear();
     m_serializedNameByType.Clear();
     // -------------------------
     Serializer = TypeModel.Create(); // create empty protobuf serializer
     Serializer.AutoAddMissingTypes     = true;
     Serializer.UseImplicitZeroDefaults = false;
 }
コード例 #5
0
        static MyObjectBuilderSerializer()
        {
            Serializer = TypeModel.Create();
            Serializer.AutoAddMissingTypes     = true;
            Serializer.UseImplicitZeroDefaults = false;

            m_objectFactory = new MyObjectFactory <MyObjectBuilderDefinitionAttribute, MyObjectBuilder_Base>();

            m_objectFactory.RegisterFromAssembly(Assembly.GetExecutingAssembly());
            m_objectFactory.RegisterFromAssembly(MyPlugins.SandboxAssembly); //TODO: Will be removed
            m_objectFactory.RegisterFromAssembly(MyPlugins.GameAssembly);
            m_objectFactory.RegisterFromAssembly(MyPlugins.UserAssembly);

            LoadSerializers();
        }