Просмотр исходного кода

ComponentsCollection ChildrenCollection反序列化使用对象池
对象池改用静态方法,主要为了兼容Unity编辑器扩展使用

tanghai 1 год назад
Родитель
Сommit
18cbea2614
34 измененных файлов с 528 добавлено и 506 удалено
  1. 2 2
      Share/Tool/Proto2CS/Proto2CS.cs
  2. 20 11
      Unity/Assets/Scripts/Core/Entity/ChildrenCollection.cs
  3. 19 10
      Unity/Assets/Scripts/Core/Entity/ComponentsCollection.cs
  4. 15 28
      Unity/Assets/Scripts/Core/Entity/Entity.cs
  5. 1 1
      Unity/Assets/Scripts/Core/Fiber/Module/Actor/MessageHelper.cs
  6. 2 2
      Unity/Assets/Scripts/Core/HashSetComponent.cs
  7. 2 2
      Unity/Assets/Scripts/Core/ListComponent.cs
  8. 2 2
      Unity/Assets/Scripts/Core/Network/MessageSerializeHelper.cs
  9. 1 1
      Unity/Assets/Scripts/Core/Object/DisposeObject.cs
  10. 1 1
      Unity/Assets/Scripts/Core/Object/MessageObject.cs
  11. 3 2
      Unity/Assets/Scripts/Core/Serialize/BsonChildrenCollectionSerializer.cs
  12. 1 1
      Unity/Assets/Scripts/Core/Serialize/BsonComponentsCollectionSerializer.cs
  13. 1 1
      Unity/Assets/Scripts/Core/Serialize/MemoryPackChildrenCollectionFormatter.cs
  14. 1 1
      Unity/Assets/Scripts/Core/Serialize/MemoryPackComponentsCollectionFormatter.cs
  15. 24 10
      Unity/Assets/Scripts/Core/World/Module/ObjectPool/ObjectPool.cs
  16. 2 2
      Unity/Assets/Scripts/Hotfix/Server/Module/ActorLocation/MessageLocationHandler.cs
  17. 1 1
      Unity/Assets/Scripts/Hotfix/Share/Module/Actor/MessageHandler.cs
  18. 8 8
      Unity/Assets/Scripts/Model/Client/Demo/NetClient/A2NetClient_Message.cs
  19. 4 4
      Unity/Assets/Scripts/Model/Generate/Client/Message/ClientMessage_C_1000.cs
  20. 24 24
      Unity/Assets/Scripts/Model/Generate/Client/Message/LockStepOuter_C_11001.cs
  21. 68 68
      Unity/Assets/Scripts/Model/Generate/Client/Message/OuterMessage_C_10001.cs
  22. 4 4
      Unity/Assets/Scripts/Model/Generate/ClientServer/Message/ClientMessage_C_1000.cs
  23. 46 46
      Unity/Assets/Scripts/Model/Generate/ClientServer/Message/InnerMessage_S_20001.cs
  24. 16 16
      Unity/Assets/Scripts/Model/Generate/ClientServer/Message/LockStepInner_S_21001.cs
  25. 24 24
      Unity/Assets/Scripts/Model/Generate/ClientServer/Message/LockStepOuter_C_11001.cs
  26. 68 68
      Unity/Assets/Scripts/Model/Generate/ClientServer/Message/OuterMessage_C_10001.cs
  27. 4 4
      Unity/Assets/Scripts/Model/Generate/Server/Message/ClientMessage_C_1000.cs
  28. 46 46
      Unity/Assets/Scripts/Model/Generate/Server/Message/InnerMessage_S_20001.cs
  29. 16 16
      Unity/Assets/Scripts/Model/Generate/Server/Message/LockStepInner_S_21001.cs
  30. 24 24
      Unity/Assets/Scripts/Model/Generate/Server/Message/LockStepOuter_C_11001.cs
  31. 68 68
      Unity/Assets/Scripts/Model/Generate/Server/Message/OuterMessage_C_10001.cs
  32. 6 6
      Unity/Assets/Scripts/Model/Server/Module/NetInner/A2NetInner_Message.cs
  33. 3 1
      Unity/Assets/Scripts/Model/Share/Entry.cs
  34. 1 1
      Unity/Assets/Scripts/Model/Share/Module/Message/MessageSessionHandler.cs

+ 2 - 2
Share/Tool/Proto2CS/Proto2CS.cs

@@ -153,7 +153,7 @@ namespace ET
                     {
                         sbDispose.Clear();
                         sb.Append("\t{\n");
-                        sb.Append($"\t\tpublic static {msgName} Create(bool isFromPool = false)\n\t\t{{\n\t\t\treturn ObjectPool.Instance.Fetch(typeof({msgName}), isFromPool) as {msgName};\n\t\t}}\n\n");
+                        sb.Append($"\t\tpublic static {msgName} Create(bool isFromPool = false)\n\t\t{{\n\t\t\treturn ObjectPool.Fetch<{msgName}>(isFromPool);\n\t\t}}\n\n");
                         continue;
                     }
 
@@ -165,7 +165,7 @@ namespace ET
                         // 加了no dispose则自己去定义dispose函数,不要自动生成
                         if (!newline.Contains("// no dispose"))
                         {
-                            sb.Append($"\t\tpublic override void Dispose()\n\t\t{{\n\t\t\tif (!this.IsFromPool)\n\t\t\t{{\n\t\t\t\treturn;\n\t\t\t}}\n\n\t\t\t{sbDispose.ToString().TrimEnd('\t')}\n\t\t\tObjectPool.Instance.Recycle(this);\n\t\t}}\n");
+                            sb.Append($"\t\tpublic override void Dispose()\n\t\t{{\n\t\t\tif (!this.IsFromPool)\n\t\t\t{{\n\t\t\t\treturn;\n\t\t\t}}\n\n\t\t\t{sbDispose.ToString().TrimEnd('\t')}\n\t\t\tObjectPool.Recycle(this);\n\t\t}}\n");
                         }
 
                         sb.Append("\t}\n\n");

+ 20 - 11
Unity/Assets/Scripts/Core/Entity/ChildrenCollection.cs

@@ -1,23 +1,32 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 
 namespace ET
 {
-    public class ChildrenCollection : SortedDictionary<long, Entity>
+    public class ChildrenCollection : SortedDictionary<long, Entity>, IPool
     {
-        public ChildrenCollection()
+        public static ChildrenCollection Create(bool isFromPool = false)
         {
+            return ObjectPool.Fetch<ChildrenCollection>(isFromPool);
         }
-
-        public ChildrenCollection(IComparer<long> comparer) : base(comparer)
+        
+        public bool IsFromPool { get; set; }
+        
+        private ChildrenCollection()
         {
         }
-
-        public ChildrenCollection(IDictionary<long, Entity> dictionary) : base(dictionary)
-        {
-        }
-
-        public ChildrenCollection(IDictionary<long, Entity> dictionary, IComparer<long> comparer) : base(dictionary, comparer)
+        
+        public void Dispose()
         {
+            if (!this.IsFromPool)
+            {
+                return;
+            }
+            
+            this.IsFromPool = false;
+            this.Clear();
+            
+            ObjectPool.Recycle(this);
         }
     }
 }

+ 19 - 10
Unity/Assets/Scripts/Core/Entity/ComponentsCollection.cs

@@ -1,23 +1,32 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 
 namespace ET
 {
-    public class ComponentsCollection : SortedDictionary<long, Entity>
+    public class ComponentsCollection : SortedDictionary<long, Entity>, IPool
     {
-        public ComponentsCollection()
+        public static ComponentsCollection Create(bool isFromPool = false)
         {
+            return ObjectPool.Fetch<ComponentsCollection>(isFromPool);
         }
-
-        public ComponentsCollection(IComparer<long> comparer) : base(comparer)
-        {
-        }
-
-        public ComponentsCollection(IDictionary<long, Entity> dictionary) : base(dictionary)
+        
+        public bool IsFromPool { get; set; }
+        
+        private ComponentsCollection()
         {
         }
 
-        public ComponentsCollection(IDictionary<long, Entity> dictionary, IComparer<long> comparer) : base(dictionary, comparer)
+        public void Dispose()
         {
+            if (!this.IsFromPool)
+            {
+                return;
+            }
+            
+            this.IsFromPool = false;
+            this.Clear();
+            
+            ObjectPool.Recycle(this);
         }
     }
 }

+ 15 - 28
Unity/Assets/Scripts/Core/Entity/Entity.cs

@@ -377,7 +377,7 @@ namespace ET
         {
             get
             {
-                return this.children ??= ObjectPool.Instance.Fetch<ChildrenCollection>();
+                return this.children ??= ObjectPool.Fetch<ChildrenCollection>();
             }
         }
 
@@ -397,8 +397,7 @@ namespace ET
 
             if (this.children.Count == 0)
             {
-                ObjectPool.Instance.Recycle(this.children);
-                this.children = null;
+                ObjectPool.Recycle(ref this.children);
             }
         }
 
@@ -413,7 +412,7 @@ namespace ET
         {
             get
             {
-                return this.components ??= ObjectPool.Instance.Fetch<ComponentsCollection>();
+                return this.components ??= ObjectPool.Fetch<ComponentsCollection>();
             }
         }
 
@@ -445,7 +444,6 @@ namespace ET
             this.IsRegister = false;
             this.InstanceId = 0;
 
-            ObjectPool objectPool = ObjectPool.Instance;
             // 清理Children
             if (this.children != null)
             {
@@ -454,12 +452,7 @@ namespace ET
                     child.Dispose();
                 }
 
-                this.children.Clear();
-
-                if (this.IsNew)
-                {
-                    objectPool.Recycle(this.children);
-                }
+                this.children.Dispose();
                 this.children = null;
             }
 
@@ -471,11 +464,7 @@ namespace ET
                     kv.Value.Dispose();
                 }
 
-                this.components.Clear();
-                if (this.IsNew)
-                {
-                    objectPool.Recycle(this.components);
-                }
+                this.components.Dispose();
                 this.components = null;
             }
 
@@ -508,7 +497,7 @@ namespace ET
             this.status = EntityStatus.None;
             this.IsFromPool = isFromPool;
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
 
         private void AddToComponents(Entity component)
@@ -527,7 +516,7 @@ namespace ET
 
             if (this.components.Count == 0)
             {
-                ObjectPool.Instance.Recycle(this.components);
+                this.components.Dispose();
                 this.components = null;
             }
         }
@@ -554,8 +543,14 @@ namespace ET
             {
                 return;
             }
-
+            
             child.Dispose();
+            
+            if (this.children.Count == 0)
+            {
+                this.children.Dispose();
+                this.children = null;
+            }
         }
 
         public void RemoveComponent<K>() where K : Entity
@@ -673,15 +668,7 @@ namespace ET
 
         private static Entity Create(Type type, bool isFromPool)
         {
-            Entity component;
-            if (isFromPool)
-            {
-                component = (Entity) ObjectPool.Instance.Fetch(type);
-            }
-            else
-            {
-                component = Activator.CreateInstance(type) as Entity;
-            }
+            Entity component = (Entity) ObjectPool.Fetch(type, isFromPool);
 
             component.IsFromPool = isFromPool;
             component.IsNew = true;

+ 1 - 1
Unity/Assets/Scripts/Core/Fiber/Module/Actor/MessageHelper.cs

@@ -7,7 +7,7 @@ namespace ET
         public static IResponse CreateResponse(Type requestType, int rpcId, int error)
         {
             Type responseType = OpcodeType.Instance.GetResponseType(requestType);
-            IResponse response = (IResponse)ObjectPool.Instance.Fetch(responseType);
+            IResponse response = (IResponse)ObjectPool.Fetch(responseType);
             response.Error = error;
             response.RpcId = rpcId;
             return response;

+ 2 - 2
Unity/Assets/Scripts/Core/HashSetComponent.cs

@@ -11,13 +11,13 @@ namespace ET
         
         public static HashSetComponent<T> Create()
         {
-            return ObjectPool.Instance.Fetch(typeof (HashSetComponent<T>)) as HashSetComponent<T>;
+            return ObjectPool.Fetch(typeof (HashSetComponent<T>)) as HashSetComponent<T>;
         }
 
         public void Dispose()
         {
             this.Clear();
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 }

+ 2 - 2
Unity/Assets/Scripts/Core/ListComponent.cs

@@ -11,7 +11,7 @@ namespace ET
         
         public static ListComponent<T> Create()
         {
-            return ObjectPool.Instance.Fetch(typeof (ListComponent<T>)) as ListComponent<T>;
+            return ObjectPool.Fetch(typeof (ListComponent<T>)) as ListComponent<T>;
         }
 
         public void Dispose()
@@ -21,7 +21,7 @@ namespace ET
                 return;
             }
             this.Clear();
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 }

+ 2 - 2
Unity/Assets/Scripts/Core/Network/MessageSerializeHelper.cs

@@ -17,14 +17,14 @@ namespace ET
 		
         public static MessageObject Deserialize(Type type, byte[] bytes, int index, int count)
         {
-            object o = ObjectPool.Instance.Fetch(type);
+            object o = ObjectPool.Fetch(type);
             MemoryPackHelper.Deserialize(type, bytes, index, count, ref o);
             return o as MessageObject;
         }
 
         public static MessageObject Deserialize(Type type, MemoryBuffer stream)
         {
-            object o = ObjectPool.Instance.Fetch(type);
+            object o = ObjectPool.Fetch(type);
             MemoryPackHelper.Deserialize(type, stream, ref o);
             return o as MessageObject;
         }

+ 1 - 1
Unity/Assets/Scripts/Core/Object/DisposeObject.cs

@@ -19,7 +19,7 @@ namespace ET
         }
     }
 
-    public interface IPool
+    public interface IPool: IDisposable
     {
         bool IsFromPool
         {

+ 1 - 1
Unity/Assets/Scripts/Core/Object/MessageObject.cs

@@ -5,7 +5,7 @@ using MongoDB.Bson.Serialization.Attributes;
 namespace ET
 {
     [DisableNew]
-    public abstract class MessageObject: ProtoObject, IMessage, IDisposable, IPool
+    public abstract class MessageObject: ProtoObject, IMessage, IPool
     {
         public virtual void Dispose()
         {

+ 3 - 2
Unity/Assets/Scripts/Core/Serialize/BsonChildrenCollectionSerializer.cs

@@ -1,4 +1,5 @@
 using MongoDB.Bson;
+using MongoDB.Bson.IO;
 using MongoDB.Bson.Serialization;
 
 namespace ET
@@ -7,7 +8,7 @@ namespace ET
     {
         public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
         {
-            ChildrenCollection childrenCollection = new ChildrenCollection();
+            ChildrenCollection childrenCollection = ChildrenCollection.Create(true);
             IBsonSerializer<Entity> bsonSerializer = BsonSerializer.LookupSerializer<Entity>();
             var bsonReader = context.Reader;
             bsonReader.ReadStartArray();
@@ -24,7 +25,7 @@ namespace ET
 
         public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
         {
-            var bsonWriter = context.Writer;
+            IBsonWriter bsonWriter = context.Writer;
             bsonWriter.WriteStartArray();
             ChildrenCollection childrenCollection = (ChildrenCollection)value;
 

+ 1 - 1
Unity/Assets/Scripts/Core/Serialize/BsonComponentsCollectionSerializer.cs

@@ -8,7 +8,7 @@ namespace ET
     {
         public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
         {
-            ComponentsCollection componentsCollection = new();
+            ComponentsCollection componentsCollection = ComponentsCollection.Create(true);
             IBsonSerializer<Entity> bsonSerializer = BsonSerializer.LookupSerializer<Entity>();
             IBsonReader bsonReader = context.Reader;
             bsonReader.ReadStartArray();

+ 1 - 1
Unity/Assets/Scripts/Core/Serialize/MemoryPackChildrenCollectionFormatter.cs

@@ -58,7 +58,7 @@ namespace ET
 
             if (value == null)
             {
-                value = new ChildrenCollection();
+                value = ChildrenCollection.Create(true);
             }
             else
             {

+ 1 - 1
Unity/Assets/Scripts/Core/Serialize/MemoryPackComponentsCollectionFormatter.cs

@@ -59,7 +59,7 @@ namespace ET
             if (value == null)
             {
                 // 这里甚至可以用对象池
-                value = new ComponentsCollection();
+                value = ComponentsCollection.Create(true);
             }
             else
             {

+ 24 - 10
Unity/Assets/Scripts/Core/World/Module/ObjectPool/ObjectPool.cs

@@ -13,25 +13,28 @@ namespace ET
 
         public void Awake()
         {
-            lock (this)
-            {
-                objPool = new ConcurrentDictionary<Type, Pool>();
-            }
+            objPool = new ConcurrentDictionary<Type, Pool>();
         }
 
-        public T Fetch<T>() where T : class
+        public static T Fetch<T>(bool isFromPool = true) where T : class, IPool
         {
-            return this.Fetch(typeof (T)) as T;
+            return Fetch(typeof (T), isFromPool) as T;
         }
 
-        public object Fetch(Type type, bool isFromPool = true)
+        // 这里改成静态方法,主要为了兼容Unity Editor模式下没有初始化ObjectPool的情况
+        public static object Fetch(Type type, bool isFromPool = true)
         {
+            if (Instance == null)
+            {
+                return Activator.CreateInstance(type);
+            }
+            
             if (!isFromPool)
             {
                 return Activator.CreateInstance(type);
             }
             
-            Pool pool = GetPool(type);
+            Pool pool = Instance.GetPool(type);
             object obj = pool.Get();
             if (obj is IPool p)
             {
@@ -40,8 +43,19 @@ namespace ET
             return obj;
         }
 
-        public void Recycle(object obj)
+        public static void Recycle<T>(ref T obj) where T : class, IPool
         {
+            Recycle(obj);
+            obj = default;
+        }
+
+        public static void Recycle(object obj)
+        {
+            if (Instance == null)
+            {
+                return;
+            }
+            
             if (obj is IPool p)
             {
                 if (!p.IsFromPool)
@@ -54,7 +68,7 @@ namespace ET
             }
 
             Type type = obj.GetType();
-            Pool pool = GetPool(type);
+            Pool pool = Instance.GetPool(type);
             pool.Return(obj);
         }
 

+ 2 - 2
Unity/Assets/Scripts/Hotfix/Server/Module/ActorLocation/MessageLocationHandler.cs

@@ -21,7 +21,7 @@ namespace ET.Server
                 return;
             }
             
-            MessageResponse response = ObjectPool.Instance.Fetch<MessageResponse>();
+            MessageResponse response = ObjectPool.Fetch<MessageResponse>();
             response.RpcId = message.RpcId;
             fiber.Root.GetComponent<ProcessInnerSender>().Reply(fromAddress, response);
 
@@ -63,7 +63,7 @@ namespace ET.Server
                 }
 
                 int rpcId = request.RpcId;
-                Response response = ObjectPool.Instance.Fetch<Response>();
+                Response response = ObjectPool.Fetch<Response>();
                 try
                 {
                     await this.Run(ee, request, response);

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Share/Module/Actor/MessageHandler.cs

@@ -61,7 +61,7 @@ namespace ET
                 }
 
                 int rpcId = request.RpcId;
-                Response response = ObjectPool.Instance.Fetch<Response>();
+                Response response = ObjectPool.Fetch<Response>();
                 try
                 {
                     await this.Run(ee, request, response);

+ 8 - 8
Unity/Assets/Scripts/Model/Client/Demo/NetClient/A2NetClient_Message.cs

@@ -5,13 +5,13 @@
     {
         public static A2NetClient_Message Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(A2NetClient_Message)) as A2NetClient_Message;
+            return ObjectPool.Fetch(typeof(A2NetClient_Message)) as A2NetClient_Message;
         }
 
         public override void Dispose()
         {
             this.MessageObject = default;
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
         
         public IMessage MessageObject;
@@ -23,14 +23,14 @@
     {
         public static A2NetClient_Request Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(A2NetClient_Request)) as A2NetClient_Request;
+            return ObjectPool.Fetch(typeof(A2NetClient_Request)) as A2NetClient_Request;
         }
 
         public override void Dispose()
         {
             this.RpcId = default;
             this.MessageObject = default;
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
      
         public int RpcId { get; set; }
@@ -42,7 +42,7 @@
     {
         public static A2NetClient_Response Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(A2NetClient_Response)) as A2NetClient_Response;
+            return ObjectPool.Fetch(typeof(A2NetClient_Response)) as A2NetClient_Response;
         }
 
         public override void Dispose()
@@ -51,7 +51,7 @@
             this.Error = default;
             this.Message = default;
             this.MessageObject = default;
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
 
         public int RpcId { get; set; }
@@ -66,12 +66,12 @@
     {
         public static NetClient2Main_SessionDispose Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(NetClient2Main_SessionDispose)) as NetClient2Main_SessionDispose;
+            return ObjectPool.Fetch(typeof(NetClient2Main_SessionDispose)) as NetClient2Main_SessionDispose;
         }
 
         public override void Dispose()
         {
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
         
         public int Error { get; set; }

+ 4 - 4
Unity/Assets/Scripts/Model/Generate/Client/Message/ClientMessage_C_1000.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static Main2NetClient_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Main2NetClient_Login), isFromPool) as Main2NetClient_Login;
+            return ObjectPool.Fetch<Main2NetClient_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -43,7 +43,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -53,7 +53,7 @@ namespace ET
     {
         public static NetClient2Main_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(NetClient2Main_Login), isFromPool) as NetClient2Main_Login;
+            return ObjectPool.Fetch<NetClient2Main_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -80,7 +80,7 @@ namespace ET
             this.Message = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 24 - 24
Unity/Assets/Scripts/Model/Generate/Client/Message/LockStepOuter_C_11001.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static C2G_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Match), isFromPool) as C2G_Match;
+            return ObjectPool.Fetch<C2G_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -25,7 +25,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -35,7 +35,7 @@ namespace ET
     {
         public static G2C_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Match), isFromPool) as G2C_Match;
+            return ObjectPool.Fetch<G2C_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -58,7 +58,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -71,7 +71,7 @@ namespace ET
     {
         public static Match2G_NotifyMatchSuccess Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2G_NotifyMatchSuccess), isFromPool) as Match2G_NotifyMatchSuccess;
+            return ObjectPool.Fetch<Match2G_NotifyMatchSuccess>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -93,7 +93,7 @@ namespace ET
             this.RpcId = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -106,7 +106,7 @@ namespace ET
     {
         public static C2Room_ChangeSceneFinish Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2Room_ChangeSceneFinish), isFromPool) as C2Room_ChangeSceneFinish;
+            return ObjectPool.Fetch<C2Room_ChangeSceneFinish>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -121,7 +121,7 @@ namespace ET
 
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -131,7 +131,7 @@ namespace ET
     {
         public static LockStepUnitInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(LockStepUnitInfo), isFromPool) as LockStepUnitInfo;
+            return ObjectPool.Fetch<LockStepUnitInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -154,7 +154,7 @@ namespace ET
             this.Position = default;
             this.Rotation = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -167,7 +167,7 @@ namespace ET
     {
         public static Room2C_Start Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_Start), isFromPool) as Room2C_Start;
+            return ObjectPool.Fetch<Room2C_Start>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -186,7 +186,7 @@ namespace ET
             this.StartTime = default;
             this.UnitInfo.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -196,7 +196,7 @@ namespace ET
     {
         public static FrameMessage Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(FrameMessage), isFromPool) as FrameMessage;
+            return ObjectPool.Fetch<FrameMessage>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -219,7 +219,7 @@ namespace ET
             this.PlayerId = default;
             this.Input = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -229,7 +229,7 @@ namespace ET
     {
         public static OneFrameInputs Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(OneFrameInputs), isFromPool) as OneFrameInputs;
+            return ObjectPool.Fetch<OneFrameInputs>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -248,7 +248,7 @@ namespace ET
             this.Frame = default;
             this.Inputs.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -258,7 +258,7 @@ namespace ET
     {
         public static Room2C_AdjustUpdateTime Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_AdjustUpdateTime), isFromPool) as Room2C_AdjustUpdateTime;
+            return ObjectPool.Fetch<Room2C_AdjustUpdateTime>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -273,7 +273,7 @@ namespace ET
 
             this.DiffTime = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -283,7 +283,7 @@ namespace ET
     {
         public static C2Room_CheckHash Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2Room_CheckHash), isFromPool) as C2Room_CheckHash;
+            return ObjectPool.Fetch<C2Room_CheckHash>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -306,7 +306,7 @@ namespace ET
             this.Frame = default;
             this.Hash = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -316,7 +316,7 @@ namespace ET
     {
         public static Room2C_CheckHashFail Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_CheckHashFail), isFromPool) as Room2C_CheckHashFail;
+            return ObjectPool.Fetch<Room2C_CheckHashFail>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -335,7 +335,7 @@ namespace ET
             this.Frame = default;
             this.LSWorldBytes = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -345,7 +345,7 @@ namespace ET
     {
         public static G2C_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Reconnect), isFromPool) as G2C_Reconnect;
+            return ObjectPool.Fetch<G2C_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -368,7 +368,7 @@ namespace ET
             this.UnitInfos.Clear();
             this.Frame = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 68 - 68
Unity/Assets/Scripts/Model/Generate/Client/Message/OuterMessage_C_10001.cs

@@ -9,7 +9,7 @@ namespace ET
     {
         public static HttpGetRouterResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(HttpGetRouterResponse), isFromPool) as HttpGetRouterResponse;
+            return ObjectPool.Fetch<HttpGetRouterResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -28,7 +28,7 @@ namespace ET
             this.Realms.Clear();
             this.Routers.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -38,7 +38,7 @@ namespace ET
     {
         public static RouterSync Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(RouterSync), isFromPool) as RouterSync;
+            return ObjectPool.Fetch<RouterSync>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -57,7 +57,7 @@ namespace ET
             this.ConnectId = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -68,7 +68,7 @@ namespace ET
     {
         public static C2M_TestRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRequest), isFromPool) as C2M_TestRequest;
+            return ObjectPool.Fetch<C2M_TestRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -87,7 +87,7 @@ namespace ET
             this.RpcId = default;
             this.request = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -97,7 +97,7 @@ namespace ET
     {
         public static M2C_TestResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestResponse), isFromPool) as M2C_TestResponse;
+            return ObjectPool.Fetch<M2C_TestResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -124,7 +124,7 @@ namespace ET
             this.Message = default;
             this.response = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -135,7 +135,7 @@ namespace ET
     {
         public static C2G_EnterMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_EnterMap), isFromPool) as C2G_EnterMap;
+            return ObjectPool.Fetch<C2G_EnterMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -150,7 +150,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -160,7 +160,7 @@ namespace ET
     {
         public static G2C_EnterMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_EnterMap), isFromPool) as G2C_EnterMap;
+            return ObjectPool.Fetch<G2C_EnterMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -190,7 +190,7 @@ namespace ET
             this.Message = default;
             this.MyId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -200,7 +200,7 @@ namespace ET
     {
         public static MoveInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(MoveInfo), isFromPool) as MoveInfo;
+            return ObjectPool.Fetch<MoveInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -223,7 +223,7 @@ namespace ET
             this.Rotation = default;
             this.TurnSpeed = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -233,7 +233,7 @@ namespace ET
     {
         public static UnitInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(UnitInfo), isFromPool) as UnitInfo;
+            return ObjectPool.Fetch<UnitInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -272,7 +272,7 @@ namespace ET
             this.KV.Clear();
             this.MoveInfo = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -282,7 +282,7 @@ namespace ET
     {
         public static M2C_CreateUnits Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_CreateUnits), isFromPool) as M2C_CreateUnits;
+            return ObjectPool.Fetch<M2C_CreateUnits>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -297,7 +297,7 @@ namespace ET
 
             this.Units.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -307,7 +307,7 @@ namespace ET
     {
         public static M2C_CreateMyUnit Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_CreateMyUnit), isFromPool) as M2C_CreateMyUnit;
+            return ObjectPool.Fetch<M2C_CreateMyUnit>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -322,7 +322,7 @@ namespace ET
 
             this.Unit = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -332,7 +332,7 @@ namespace ET
     {
         public static M2C_StartSceneChange Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_StartSceneChange), isFromPool) as M2C_StartSceneChange;
+            return ObjectPool.Fetch<M2C_StartSceneChange>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -351,7 +351,7 @@ namespace ET
             this.SceneInstanceId = default;
             this.SceneName = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -361,7 +361,7 @@ namespace ET
     {
         public static M2C_RemoveUnits Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_RemoveUnits), isFromPool) as M2C_RemoveUnits;
+            return ObjectPool.Fetch<M2C_RemoveUnits>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -376,7 +376,7 @@ namespace ET
 
             this.Units.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -386,7 +386,7 @@ namespace ET
     {
         public static C2M_PathfindingResult Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_PathfindingResult), isFromPool) as C2M_PathfindingResult;
+            return ObjectPool.Fetch<C2M_PathfindingResult>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -405,7 +405,7 @@ namespace ET
             this.RpcId = default;
             this.Position = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -415,7 +415,7 @@ namespace ET
     {
         public static C2M_Stop Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_Stop), isFromPool) as C2M_Stop;
+            return ObjectPool.Fetch<C2M_Stop>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -430,7 +430,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -440,7 +440,7 @@ namespace ET
     {
         public static M2C_PathfindingResult Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_PathfindingResult), isFromPool) as M2C_PathfindingResult;
+            return ObjectPool.Fetch<M2C_PathfindingResult>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -463,7 +463,7 @@ namespace ET
             this.Position = default;
             this.Points.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -473,7 +473,7 @@ namespace ET
     {
         public static M2C_Stop Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_Stop), isFromPool) as M2C_Stop;
+            return ObjectPool.Fetch<M2C_Stop>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -500,7 +500,7 @@ namespace ET
             this.Position = default;
             this.Rotation = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -511,7 +511,7 @@ namespace ET
     {
         public static C2G_Ping Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Ping), isFromPool) as C2G_Ping;
+            return ObjectPool.Fetch<C2G_Ping>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -526,7 +526,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -536,7 +536,7 @@ namespace ET
     {
         public static G2C_Ping Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Ping), isFromPool) as G2C_Ping;
+            return ObjectPool.Fetch<G2C_Ping>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -563,7 +563,7 @@ namespace ET
             this.Message = default;
             this.Time = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -573,7 +573,7 @@ namespace ET
     {
         public static G2C_Test Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Test), isFromPool) as G2C_Test;
+            return ObjectPool.Fetch<G2C_Test>(isFromPool);
         }
 
         public override void Dispose()
@@ -584,7 +584,7 @@ namespace ET
             }
 
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -595,7 +595,7 @@ namespace ET
     {
         public static C2M_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_Reload), isFromPool) as C2M_Reload;
+            return ObjectPool.Fetch<C2M_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -618,7 +618,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -628,7 +628,7 @@ namespace ET
     {
         public static M2C_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_Reload), isFromPool) as M2C_Reload;
+            return ObjectPool.Fetch<M2C_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -651,7 +651,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -662,7 +662,7 @@ namespace ET
     {
         public static C2R_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2R_Login), isFromPool) as C2R_Login;
+            return ObjectPool.Fetch<C2R_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -691,7 +691,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -701,7 +701,7 @@ namespace ET
     {
         public static R2C_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(R2C_Login), isFromPool) as R2C_Login;
+            return ObjectPool.Fetch<R2C_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -736,7 +736,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -747,7 +747,7 @@ namespace ET
     {
         public static C2G_LoginGate Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_LoginGate), isFromPool) as C2G_LoginGate;
+            return ObjectPool.Fetch<C2G_LoginGate>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -773,7 +773,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -783,7 +783,7 @@ namespace ET
     {
         public static G2C_LoginGate Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_LoginGate), isFromPool) as G2C_LoginGate;
+            return ObjectPool.Fetch<G2C_LoginGate>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -810,7 +810,7 @@ namespace ET
             this.Message = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -820,7 +820,7 @@ namespace ET
     {
         public static G2C_TestHotfixMessage Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_TestHotfixMessage), isFromPool) as G2C_TestHotfixMessage;
+            return ObjectPool.Fetch<G2C_TestHotfixMessage>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -835,7 +835,7 @@ namespace ET
 
             this.Info = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -846,7 +846,7 @@ namespace ET
     {
         public static C2M_TestRobotCase Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRobotCase), isFromPool) as C2M_TestRobotCase;
+            return ObjectPool.Fetch<C2M_TestRobotCase>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -865,7 +865,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -875,7 +875,7 @@ namespace ET
     {
         public static M2C_TestRobotCase Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestRobotCase), isFromPool) as M2C_TestRobotCase;
+            return ObjectPool.Fetch<M2C_TestRobotCase>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -902,7 +902,7 @@ namespace ET
             this.Message = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -912,7 +912,7 @@ namespace ET
     {
         public static C2M_TestRobotCase2 Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRobotCase2), isFromPool) as C2M_TestRobotCase2;
+            return ObjectPool.Fetch<C2M_TestRobotCase2>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -931,7 +931,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -941,7 +941,7 @@ namespace ET
     {
         public static M2C_TestRobotCase2 Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestRobotCase2), isFromPool) as M2C_TestRobotCase2;
+            return ObjectPool.Fetch<M2C_TestRobotCase2>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -960,7 +960,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -971,7 +971,7 @@ namespace ET
     {
         public static C2M_TransferMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TransferMap), isFromPool) as C2M_TransferMap;
+            return ObjectPool.Fetch<C2M_TransferMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -986,7 +986,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -996,7 +996,7 @@ namespace ET
     {
         public static M2C_TransferMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TransferMap), isFromPool) as M2C_TransferMap;
+            return ObjectPool.Fetch<M2C_TransferMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1019,7 +1019,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -1030,7 +1030,7 @@ namespace ET
     {
         public static C2G_Benchmark Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Benchmark), isFromPool) as C2G_Benchmark;
+            return ObjectPool.Fetch<C2G_Benchmark>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1045,7 +1045,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -1055,7 +1055,7 @@ namespace ET
     {
         public static G2C_Benchmark Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Benchmark), isFromPool) as G2C_Benchmark;
+            return ObjectPool.Fetch<G2C_Benchmark>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1078,7 +1078,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 4 - 4
Unity/Assets/Scripts/Model/Generate/ClientServer/Message/ClientMessage_C_1000.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static Main2NetClient_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Main2NetClient_Login), isFromPool) as Main2NetClient_Login;
+            return ObjectPool.Fetch<Main2NetClient_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -43,7 +43,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -53,7 +53,7 @@ namespace ET
     {
         public static NetClient2Main_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(NetClient2Main_Login), isFromPool) as NetClient2Main_Login;
+            return ObjectPool.Fetch<NetClient2Main_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -80,7 +80,7 @@ namespace ET
             this.Message = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 46 - 46
Unity/Assets/Scripts/Model/Generate/ClientServer/Message/InnerMessage_S_20001.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static ObjectQueryRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectQueryRequest), isFromPool) as ObjectQueryRequest;
+            return ObjectPool.Fetch<ObjectQueryRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -33,7 +33,7 @@ namespace ET
             this.Key = default;
             this.InstanceId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -44,7 +44,7 @@ namespace ET
     {
         public static M2A_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2A_Reload), isFromPool) as M2A_Reload;
+            return ObjectPool.Fetch<M2A_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -59,7 +59,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -69,7 +69,7 @@ namespace ET
     {
         public static A2M_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(A2M_Reload), isFromPool) as A2M_Reload;
+            return ObjectPool.Fetch<A2M_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -92,7 +92,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -103,7 +103,7 @@ namespace ET
     {
         public static G2G_LockRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockRequest), isFromPool) as G2G_LockRequest;
+            return ObjectPool.Fetch<G2G_LockRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -126,7 +126,7 @@ namespace ET
             this.Id = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -136,7 +136,7 @@ namespace ET
     {
         public static G2G_LockResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockResponse), isFromPool) as G2G_LockResponse;
+            return ObjectPool.Fetch<G2G_LockResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -159,7 +159,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -170,7 +170,7 @@ namespace ET
     {
         public static G2G_LockReleaseRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockReleaseRequest), isFromPool) as G2G_LockReleaseRequest;
+            return ObjectPool.Fetch<G2G_LockReleaseRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -193,7 +193,7 @@ namespace ET
             this.Id = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -203,7 +203,7 @@ namespace ET
     {
         public static G2G_LockReleaseResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockReleaseResponse), isFromPool) as G2G_LockReleaseResponse;
+            return ObjectPool.Fetch<G2G_LockReleaseResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -226,7 +226,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -237,7 +237,7 @@ namespace ET
     {
         public static ObjectAddRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectAddRequest), isFromPool) as ObjectAddRequest;
+            return ObjectPool.Fetch<ObjectAddRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -264,7 +264,7 @@ namespace ET
             this.Key = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -274,7 +274,7 @@ namespace ET
     {
         public static ObjectAddResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectAddResponse), isFromPool) as ObjectAddResponse;
+            return ObjectPool.Fetch<ObjectAddResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -297,7 +297,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -308,7 +308,7 @@ namespace ET
     {
         public static ObjectLockRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectLockRequest), isFromPool) as ObjectLockRequest;
+            return ObjectPool.Fetch<ObjectLockRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -339,7 +339,7 @@ namespace ET
             this.ActorId = default;
             this.Time = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -349,7 +349,7 @@ namespace ET
     {
         public static ObjectLockResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectLockResponse), isFromPool) as ObjectLockResponse;
+            return ObjectPool.Fetch<ObjectLockResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -372,7 +372,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -383,7 +383,7 @@ namespace ET
     {
         public static ObjectUnLockRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectUnLockRequest), isFromPool) as ObjectUnLockRequest;
+            return ObjectPool.Fetch<ObjectUnLockRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -414,7 +414,7 @@ namespace ET
             this.OldActorId = default;
             this.NewActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -424,7 +424,7 @@ namespace ET
     {
         public static ObjectUnLockResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectUnLockResponse), isFromPool) as ObjectUnLockResponse;
+            return ObjectPool.Fetch<ObjectUnLockResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -447,7 +447,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -458,7 +458,7 @@ namespace ET
     {
         public static ObjectRemoveRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectRemoveRequest), isFromPool) as ObjectRemoveRequest;
+            return ObjectPool.Fetch<ObjectRemoveRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -481,7 +481,7 @@ namespace ET
             this.Type = default;
             this.Key = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -491,7 +491,7 @@ namespace ET
     {
         public static ObjectRemoveResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectRemoveResponse), isFromPool) as ObjectRemoveResponse;
+            return ObjectPool.Fetch<ObjectRemoveResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -514,7 +514,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -525,7 +525,7 @@ namespace ET
     {
         public static ObjectGetRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectGetRequest), isFromPool) as ObjectGetRequest;
+            return ObjectPool.Fetch<ObjectGetRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -548,7 +548,7 @@ namespace ET
             this.Type = default;
             this.Key = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -558,7 +558,7 @@ namespace ET
     {
         public static ObjectGetResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectGetResponse), isFromPool) as ObjectGetResponse;
+            return ObjectPool.Fetch<ObjectGetResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -589,7 +589,7 @@ namespace ET
             this.Type = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -600,7 +600,7 @@ namespace ET
     {
         public static R2G_GetLoginKey Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(R2G_GetLoginKey), isFromPool) as R2G_GetLoginKey;
+            return ObjectPool.Fetch<R2G_GetLoginKey>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -619,7 +619,7 @@ namespace ET
             this.RpcId = default;
             this.Account = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -629,7 +629,7 @@ namespace ET
     {
         public static G2R_GetLoginKey Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2R_GetLoginKey), isFromPool) as G2R_GetLoginKey;
+            return ObjectPool.Fetch<G2R_GetLoginKey>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -660,7 +660,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -670,7 +670,7 @@ namespace ET
     {
         public static G2M_SessionDisconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2M_SessionDisconnect), isFromPool) as G2M_SessionDisconnect;
+            return ObjectPool.Fetch<G2M_SessionDisconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -685,7 +685,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -695,7 +695,7 @@ namespace ET
     {
         public static ObjectQueryResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectQueryResponse), isFromPool) as ObjectQueryResponse;
+            return ObjectPool.Fetch<ObjectQueryResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -722,7 +722,7 @@ namespace ET
             this.Message = default;
             this.Entity = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -733,7 +733,7 @@ namespace ET
     {
         public static M2M_UnitTransferRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2M_UnitTransferRequest), isFromPool) as M2M_UnitTransferRequest;
+            return ObjectPool.Fetch<M2M_UnitTransferRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -760,7 +760,7 @@ namespace ET
             this.Unit = default;
             this.Entitys.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -770,7 +770,7 @@ namespace ET
     {
         public static M2M_UnitTransferResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2M_UnitTransferResponse), isFromPool) as M2M_UnitTransferResponse;
+            return ObjectPool.Fetch<M2M_UnitTransferResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -793,7 +793,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 16 - 16
Unity/Assets/Scripts/Model/Generate/ClientServer/Message/LockStepInner_S_21001.cs

@@ -13,7 +13,7 @@ namespace ET
     {
         public static G2Match_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2Match_Match), isFromPool) as G2Match_Match;
+            return ObjectPool.Fetch<G2Match_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -32,7 +32,7 @@ namespace ET
             this.RpcId = default;
             this.Id = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -42,7 +42,7 @@ namespace ET
     {
         public static Match2G_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2G_Match), isFromPool) as Match2G_Match;
+            return ObjectPool.Fetch<Match2G_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -65,7 +65,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -76,7 +76,7 @@ namespace ET
     {
         public static Match2Map_GetRoom Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2Map_GetRoom), isFromPool) as Match2Map_GetRoom;
+            return ObjectPool.Fetch<Match2Map_GetRoom>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -95,7 +95,7 @@ namespace ET
             this.RpcId = default;
             this.PlayerIds.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -105,7 +105,7 @@ namespace ET
     {
         public static Map2Match_GetRoom Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Map2Match_GetRoom), isFromPool) as Map2Match_GetRoom;
+            return ObjectPool.Fetch<Map2Match_GetRoom>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -135,7 +135,7 @@ namespace ET
             this.Message = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -146,7 +146,7 @@ namespace ET
     {
         public static G2Room_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2Room_Reconnect), isFromPool) as G2Room_Reconnect;
+            return ObjectPool.Fetch<G2Room_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -165,7 +165,7 @@ namespace ET
             this.RpcId = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -175,7 +175,7 @@ namespace ET
     {
         public static Room2G_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2G_Reconnect), isFromPool) as Room2G_Reconnect;
+            return ObjectPool.Fetch<Room2G_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -210,7 +210,7 @@ namespace ET
             this.UnitInfos.Clear();
             this.Frame = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -221,7 +221,7 @@ namespace ET
     {
         public static RoomManager2Room_Init Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(RoomManager2Room_Init), isFromPool) as RoomManager2Room_Init;
+            return ObjectPool.Fetch<RoomManager2Room_Init>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -240,7 +240,7 @@ namespace ET
             this.RpcId = default;
             this.PlayerIds.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -250,7 +250,7 @@ namespace ET
     {
         public static Room2RoomManager_Init Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2RoomManager_Init), isFromPool) as Room2RoomManager_Init;
+            return ObjectPool.Fetch<Room2RoomManager_Init>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -273,7 +273,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 24 - 24
Unity/Assets/Scripts/Model/Generate/ClientServer/Message/LockStepOuter_C_11001.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static C2G_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Match), isFromPool) as C2G_Match;
+            return ObjectPool.Fetch<C2G_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -25,7 +25,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -35,7 +35,7 @@ namespace ET
     {
         public static G2C_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Match), isFromPool) as G2C_Match;
+            return ObjectPool.Fetch<G2C_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -58,7 +58,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -71,7 +71,7 @@ namespace ET
     {
         public static Match2G_NotifyMatchSuccess Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2G_NotifyMatchSuccess), isFromPool) as Match2G_NotifyMatchSuccess;
+            return ObjectPool.Fetch<Match2G_NotifyMatchSuccess>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -93,7 +93,7 @@ namespace ET
             this.RpcId = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -106,7 +106,7 @@ namespace ET
     {
         public static C2Room_ChangeSceneFinish Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2Room_ChangeSceneFinish), isFromPool) as C2Room_ChangeSceneFinish;
+            return ObjectPool.Fetch<C2Room_ChangeSceneFinish>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -121,7 +121,7 @@ namespace ET
 
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -131,7 +131,7 @@ namespace ET
     {
         public static LockStepUnitInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(LockStepUnitInfo), isFromPool) as LockStepUnitInfo;
+            return ObjectPool.Fetch<LockStepUnitInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -154,7 +154,7 @@ namespace ET
             this.Position = default;
             this.Rotation = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -167,7 +167,7 @@ namespace ET
     {
         public static Room2C_Start Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_Start), isFromPool) as Room2C_Start;
+            return ObjectPool.Fetch<Room2C_Start>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -186,7 +186,7 @@ namespace ET
             this.StartTime = default;
             this.UnitInfo.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -196,7 +196,7 @@ namespace ET
     {
         public static FrameMessage Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(FrameMessage), isFromPool) as FrameMessage;
+            return ObjectPool.Fetch<FrameMessage>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -219,7 +219,7 @@ namespace ET
             this.PlayerId = default;
             this.Input = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -229,7 +229,7 @@ namespace ET
     {
         public static OneFrameInputs Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(OneFrameInputs), isFromPool) as OneFrameInputs;
+            return ObjectPool.Fetch<OneFrameInputs>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -248,7 +248,7 @@ namespace ET
             this.Frame = default;
             this.Inputs.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -258,7 +258,7 @@ namespace ET
     {
         public static Room2C_AdjustUpdateTime Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_AdjustUpdateTime), isFromPool) as Room2C_AdjustUpdateTime;
+            return ObjectPool.Fetch<Room2C_AdjustUpdateTime>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -273,7 +273,7 @@ namespace ET
 
             this.DiffTime = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -283,7 +283,7 @@ namespace ET
     {
         public static C2Room_CheckHash Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2Room_CheckHash), isFromPool) as C2Room_CheckHash;
+            return ObjectPool.Fetch<C2Room_CheckHash>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -306,7 +306,7 @@ namespace ET
             this.Frame = default;
             this.Hash = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -316,7 +316,7 @@ namespace ET
     {
         public static Room2C_CheckHashFail Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_CheckHashFail), isFromPool) as Room2C_CheckHashFail;
+            return ObjectPool.Fetch<Room2C_CheckHashFail>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -335,7 +335,7 @@ namespace ET
             this.Frame = default;
             this.LSWorldBytes = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -345,7 +345,7 @@ namespace ET
     {
         public static G2C_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Reconnect), isFromPool) as G2C_Reconnect;
+            return ObjectPool.Fetch<G2C_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -368,7 +368,7 @@ namespace ET
             this.UnitInfos.Clear();
             this.Frame = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 68 - 68
Unity/Assets/Scripts/Model/Generate/ClientServer/Message/OuterMessage_C_10001.cs

@@ -9,7 +9,7 @@ namespace ET
     {
         public static HttpGetRouterResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(HttpGetRouterResponse), isFromPool) as HttpGetRouterResponse;
+            return ObjectPool.Fetch<HttpGetRouterResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -28,7 +28,7 @@ namespace ET
             this.Realms.Clear();
             this.Routers.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -38,7 +38,7 @@ namespace ET
     {
         public static RouterSync Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(RouterSync), isFromPool) as RouterSync;
+            return ObjectPool.Fetch<RouterSync>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -57,7 +57,7 @@ namespace ET
             this.ConnectId = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -68,7 +68,7 @@ namespace ET
     {
         public static C2M_TestRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRequest), isFromPool) as C2M_TestRequest;
+            return ObjectPool.Fetch<C2M_TestRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -87,7 +87,7 @@ namespace ET
             this.RpcId = default;
             this.request = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -97,7 +97,7 @@ namespace ET
     {
         public static M2C_TestResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestResponse), isFromPool) as M2C_TestResponse;
+            return ObjectPool.Fetch<M2C_TestResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -124,7 +124,7 @@ namespace ET
             this.Message = default;
             this.response = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -135,7 +135,7 @@ namespace ET
     {
         public static C2G_EnterMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_EnterMap), isFromPool) as C2G_EnterMap;
+            return ObjectPool.Fetch<C2G_EnterMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -150,7 +150,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -160,7 +160,7 @@ namespace ET
     {
         public static G2C_EnterMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_EnterMap), isFromPool) as G2C_EnterMap;
+            return ObjectPool.Fetch<G2C_EnterMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -190,7 +190,7 @@ namespace ET
             this.Message = default;
             this.MyId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -200,7 +200,7 @@ namespace ET
     {
         public static MoveInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(MoveInfo), isFromPool) as MoveInfo;
+            return ObjectPool.Fetch<MoveInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -223,7 +223,7 @@ namespace ET
             this.Rotation = default;
             this.TurnSpeed = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -233,7 +233,7 @@ namespace ET
     {
         public static UnitInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(UnitInfo), isFromPool) as UnitInfo;
+            return ObjectPool.Fetch<UnitInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -272,7 +272,7 @@ namespace ET
             this.KV.Clear();
             this.MoveInfo = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -282,7 +282,7 @@ namespace ET
     {
         public static M2C_CreateUnits Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_CreateUnits), isFromPool) as M2C_CreateUnits;
+            return ObjectPool.Fetch<M2C_CreateUnits>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -297,7 +297,7 @@ namespace ET
 
             this.Units.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -307,7 +307,7 @@ namespace ET
     {
         public static M2C_CreateMyUnit Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_CreateMyUnit), isFromPool) as M2C_CreateMyUnit;
+            return ObjectPool.Fetch<M2C_CreateMyUnit>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -322,7 +322,7 @@ namespace ET
 
             this.Unit = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -332,7 +332,7 @@ namespace ET
     {
         public static M2C_StartSceneChange Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_StartSceneChange), isFromPool) as M2C_StartSceneChange;
+            return ObjectPool.Fetch<M2C_StartSceneChange>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -351,7 +351,7 @@ namespace ET
             this.SceneInstanceId = default;
             this.SceneName = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -361,7 +361,7 @@ namespace ET
     {
         public static M2C_RemoveUnits Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_RemoveUnits), isFromPool) as M2C_RemoveUnits;
+            return ObjectPool.Fetch<M2C_RemoveUnits>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -376,7 +376,7 @@ namespace ET
 
             this.Units.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -386,7 +386,7 @@ namespace ET
     {
         public static C2M_PathfindingResult Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_PathfindingResult), isFromPool) as C2M_PathfindingResult;
+            return ObjectPool.Fetch<C2M_PathfindingResult>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -405,7 +405,7 @@ namespace ET
             this.RpcId = default;
             this.Position = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -415,7 +415,7 @@ namespace ET
     {
         public static C2M_Stop Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_Stop), isFromPool) as C2M_Stop;
+            return ObjectPool.Fetch<C2M_Stop>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -430,7 +430,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -440,7 +440,7 @@ namespace ET
     {
         public static M2C_PathfindingResult Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_PathfindingResult), isFromPool) as M2C_PathfindingResult;
+            return ObjectPool.Fetch<M2C_PathfindingResult>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -463,7 +463,7 @@ namespace ET
             this.Position = default;
             this.Points.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -473,7 +473,7 @@ namespace ET
     {
         public static M2C_Stop Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_Stop), isFromPool) as M2C_Stop;
+            return ObjectPool.Fetch<M2C_Stop>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -500,7 +500,7 @@ namespace ET
             this.Position = default;
             this.Rotation = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -511,7 +511,7 @@ namespace ET
     {
         public static C2G_Ping Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Ping), isFromPool) as C2G_Ping;
+            return ObjectPool.Fetch<C2G_Ping>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -526,7 +526,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -536,7 +536,7 @@ namespace ET
     {
         public static G2C_Ping Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Ping), isFromPool) as G2C_Ping;
+            return ObjectPool.Fetch<G2C_Ping>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -563,7 +563,7 @@ namespace ET
             this.Message = default;
             this.Time = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -573,7 +573,7 @@ namespace ET
     {
         public static G2C_Test Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Test), isFromPool) as G2C_Test;
+            return ObjectPool.Fetch<G2C_Test>(isFromPool);
         }
 
         public override void Dispose()
@@ -584,7 +584,7 @@ namespace ET
             }
 
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -595,7 +595,7 @@ namespace ET
     {
         public static C2M_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_Reload), isFromPool) as C2M_Reload;
+            return ObjectPool.Fetch<C2M_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -618,7 +618,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -628,7 +628,7 @@ namespace ET
     {
         public static M2C_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_Reload), isFromPool) as M2C_Reload;
+            return ObjectPool.Fetch<M2C_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -651,7 +651,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -662,7 +662,7 @@ namespace ET
     {
         public static C2R_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2R_Login), isFromPool) as C2R_Login;
+            return ObjectPool.Fetch<C2R_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -691,7 +691,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -701,7 +701,7 @@ namespace ET
     {
         public static R2C_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(R2C_Login), isFromPool) as R2C_Login;
+            return ObjectPool.Fetch<R2C_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -736,7 +736,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -747,7 +747,7 @@ namespace ET
     {
         public static C2G_LoginGate Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_LoginGate), isFromPool) as C2G_LoginGate;
+            return ObjectPool.Fetch<C2G_LoginGate>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -773,7 +773,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -783,7 +783,7 @@ namespace ET
     {
         public static G2C_LoginGate Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_LoginGate), isFromPool) as G2C_LoginGate;
+            return ObjectPool.Fetch<G2C_LoginGate>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -810,7 +810,7 @@ namespace ET
             this.Message = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -820,7 +820,7 @@ namespace ET
     {
         public static G2C_TestHotfixMessage Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_TestHotfixMessage), isFromPool) as G2C_TestHotfixMessage;
+            return ObjectPool.Fetch<G2C_TestHotfixMessage>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -835,7 +835,7 @@ namespace ET
 
             this.Info = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -846,7 +846,7 @@ namespace ET
     {
         public static C2M_TestRobotCase Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRobotCase), isFromPool) as C2M_TestRobotCase;
+            return ObjectPool.Fetch<C2M_TestRobotCase>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -865,7 +865,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -875,7 +875,7 @@ namespace ET
     {
         public static M2C_TestRobotCase Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestRobotCase), isFromPool) as M2C_TestRobotCase;
+            return ObjectPool.Fetch<M2C_TestRobotCase>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -902,7 +902,7 @@ namespace ET
             this.Message = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -912,7 +912,7 @@ namespace ET
     {
         public static C2M_TestRobotCase2 Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRobotCase2), isFromPool) as C2M_TestRobotCase2;
+            return ObjectPool.Fetch<C2M_TestRobotCase2>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -931,7 +931,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -941,7 +941,7 @@ namespace ET
     {
         public static M2C_TestRobotCase2 Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestRobotCase2), isFromPool) as M2C_TestRobotCase2;
+            return ObjectPool.Fetch<M2C_TestRobotCase2>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -960,7 +960,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -971,7 +971,7 @@ namespace ET
     {
         public static C2M_TransferMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TransferMap), isFromPool) as C2M_TransferMap;
+            return ObjectPool.Fetch<C2M_TransferMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -986,7 +986,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -996,7 +996,7 @@ namespace ET
     {
         public static M2C_TransferMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TransferMap), isFromPool) as M2C_TransferMap;
+            return ObjectPool.Fetch<M2C_TransferMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1019,7 +1019,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -1030,7 +1030,7 @@ namespace ET
     {
         public static C2G_Benchmark Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Benchmark), isFromPool) as C2G_Benchmark;
+            return ObjectPool.Fetch<C2G_Benchmark>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1045,7 +1045,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -1055,7 +1055,7 @@ namespace ET
     {
         public static G2C_Benchmark Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Benchmark), isFromPool) as G2C_Benchmark;
+            return ObjectPool.Fetch<G2C_Benchmark>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1078,7 +1078,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 4 - 4
Unity/Assets/Scripts/Model/Generate/Server/Message/ClientMessage_C_1000.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static Main2NetClient_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Main2NetClient_Login), isFromPool) as Main2NetClient_Login;
+            return ObjectPool.Fetch<Main2NetClient_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -43,7 +43,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -53,7 +53,7 @@ namespace ET
     {
         public static NetClient2Main_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(NetClient2Main_Login), isFromPool) as NetClient2Main_Login;
+            return ObjectPool.Fetch<NetClient2Main_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -80,7 +80,7 @@ namespace ET
             this.Message = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 46 - 46
Unity/Assets/Scripts/Model/Generate/Server/Message/InnerMessage_S_20001.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static ObjectQueryRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectQueryRequest), isFromPool) as ObjectQueryRequest;
+            return ObjectPool.Fetch<ObjectQueryRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -33,7 +33,7 @@ namespace ET
             this.Key = default;
             this.InstanceId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -44,7 +44,7 @@ namespace ET
     {
         public static M2A_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2A_Reload), isFromPool) as M2A_Reload;
+            return ObjectPool.Fetch<M2A_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -59,7 +59,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -69,7 +69,7 @@ namespace ET
     {
         public static A2M_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(A2M_Reload), isFromPool) as A2M_Reload;
+            return ObjectPool.Fetch<A2M_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -92,7 +92,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -103,7 +103,7 @@ namespace ET
     {
         public static G2G_LockRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockRequest), isFromPool) as G2G_LockRequest;
+            return ObjectPool.Fetch<G2G_LockRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -126,7 +126,7 @@ namespace ET
             this.Id = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -136,7 +136,7 @@ namespace ET
     {
         public static G2G_LockResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockResponse), isFromPool) as G2G_LockResponse;
+            return ObjectPool.Fetch<G2G_LockResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -159,7 +159,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -170,7 +170,7 @@ namespace ET
     {
         public static G2G_LockReleaseRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockReleaseRequest), isFromPool) as G2G_LockReleaseRequest;
+            return ObjectPool.Fetch<G2G_LockReleaseRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -193,7 +193,7 @@ namespace ET
             this.Id = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -203,7 +203,7 @@ namespace ET
     {
         public static G2G_LockReleaseResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2G_LockReleaseResponse), isFromPool) as G2G_LockReleaseResponse;
+            return ObjectPool.Fetch<G2G_LockReleaseResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -226,7 +226,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -237,7 +237,7 @@ namespace ET
     {
         public static ObjectAddRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectAddRequest), isFromPool) as ObjectAddRequest;
+            return ObjectPool.Fetch<ObjectAddRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -264,7 +264,7 @@ namespace ET
             this.Key = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -274,7 +274,7 @@ namespace ET
     {
         public static ObjectAddResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectAddResponse), isFromPool) as ObjectAddResponse;
+            return ObjectPool.Fetch<ObjectAddResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -297,7 +297,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -308,7 +308,7 @@ namespace ET
     {
         public static ObjectLockRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectLockRequest), isFromPool) as ObjectLockRequest;
+            return ObjectPool.Fetch<ObjectLockRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -339,7 +339,7 @@ namespace ET
             this.ActorId = default;
             this.Time = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -349,7 +349,7 @@ namespace ET
     {
         public static ObjectLockResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectLockResponse), isFromPool) as ObjectLockResponse;
+            return ObjectPool.Fetch<ObjectLockResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -372,7 +372,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -383,7 +383,7 @@ namespace ET
     {
         public static ObjectUnLockRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectUnLockRequest), isFromPool) as ObjectUnLockRequest;
+            return ObjectPool.Fetch<ObjectUnLockRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -414,7 +414,7 @@ namespace ET
             this.OldActorId = default;
             this.NewActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -424,7 +424,7 @@ namespace ET
     {
         public static ObjectUnLockResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectUnLockResponse), isFromPool) as ObjectUnLockResponse;
+            return ObjectPool.Fetch<ObjectUnLockResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -447,7 +447,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -458,7 +458,7 @@ namespace ET
     {
         public static ObjectRemoveRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectRemoveRequest), isFromPool) as ObjectRemoveRequest;
+            return ObjectPool.Fetch<ObjectRemoveRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -481,7 +481,7 @@ namespace ET
             this.Type = default;
             this.Key = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -491,7 +491,7 @@ namespace ET
     {
         public static ObjectRemoveResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectRemoveResponse), isFromPool) as ObjectRemoveResponse;
+            return ObjectPool.Fetch<ObjectRemoveResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -514,7 +514,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -525,7 +525,7 @@ namespace ET
     {
         public static ObjectGetRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectGetRequest), isFromPool) as ObjectGetRequest;
+            return ObjectPool.Fetch<ObjectGetRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -548,7 +548,7 @@ namespace ET
             this.Type = default;
             this.Key = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -558,7 +558,7 @@ namespace ET
     {
         public static ObjectGetResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectGetResponse), isFromPool) as ObjectGetResponse;
+            return ObjectPool.Fetch<ObjectGetResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -589,7 +589,7 @@ namespace ET
             this.Type = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -600,7 +600,7 @@ namespace ET
     {
         public static R2G_GetLoginKey Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(R2G_GetLoginKey), isFromPool) as R2G_GetLoginKey;
+            return ObjectPool.Fetch<R2G_GetLoginKey>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -619,7 +619,7 @@ namespace ET
             this.RpcId = default;
             this.Account = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -629,7 +629,7 @@ namespace ET
     {
         public static G2R_GetLoginKey Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2R_GetLoginKey), isFromPool) as G2R_GetLoginKey;
+            return ObjectPool.Fetch<G2R_GetLoginKey>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -660,7 +660,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -670,7 +670,7 @@ namespace ET
     {
         public static G2M_SessionDisconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2M_SessionDisconnect), isFromPool) as G2M_SessionDisconnect;
+            return ObjectPool.Fetch<G2M_SessionDisconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -685,7 +685,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -695,7 +695,7 @@ namespace ET
     {
         public static ObjectQueryResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(ObjectQueryResponse), isFromPool) as ObjectQueryResponse;
+            return ObjectPool.Fetch<ObjectQueryResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -722,7 +722,7 @@ namespace ET
             this.Message = default;
             this.Entity = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -733,7 +733,7 @@ namespace ET
     {
         public static M2M_UnitTransferRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2M_UnitTransferRequest), isFromPool) as M2M_UnitTransferRequest;
+            return ObjectPool.Fetch<M2M_UnitTransferRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -760,7 +760,7 @@ namespace ET
             this.Unit = default;
             this.Entitys.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -770,7 +770,7 @@ namespace ET
     {
         public static M2M_UnitTransferResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2M_UnitTransferResponse), isFromPool) as M2M_UnitTransferResponse;
+            return ObjectPool.Fetch<M2M_UnitTransferResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -793,7 +793,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 16 - 16
Unity/Assets/Scripts/Model/Generate/Server/Message/LockStepInner_S_21001.cs

@@ -13,7 +13,7 @@ namespace ET
     {
         public static G2Match_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2Match_Match), isFromPool) as G2Match_Match;
+            return ObjectPool.Fetch<G2Match_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -32,7 +32,7 @@ namespace ET
             this.RpcId = default;
             this.Id = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -42,7 +42,7 @@ namespace ET
     {
         public static Match2G_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2G_Match), isFromPool) as Match2G_Match;
+            return ObjectPool.Fetch<Match2G_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -65,7 +65,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -76,7 +76,7 @@ namespace ET
     {
         public static Match2Map_GetRoom Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2Map_GetRoom), isFromPool) as Match2Map_GetRoom;
+            return ObjectPool.Fetch<Match2Map_GetRoom>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -95,7 +95,7 @@ namespace ET
             this.RpcId = default;
             this.PlayerIds.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -105,7 +105,7 @@ namespace ET
     {
         public static Map2Match_GetRoom Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Map2Match_GetRoom), isFromPool) as Map2Match_GetRoom;
+            return ObjectPool.Fetch<Map2Match_GetRoom>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -135,7 +135,7 @@ namespace ET
             this.Message = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -146,7 +146,7 @@ namespace ET
     {
         public static G2Room_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2Room_Reconnect), isFromPool) as G2Room_Reconnect;
+            return ObjectPool.Fetch<G2Room_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -165,7 +165,7 @@ namespace ET
             this.RpcId = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -175,7 +175,7 @@ namespace ET
     {
         public static Room2G_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2G_Reconnect), isFromPool) as Room2G_Reconnect;
+            return ObjectPool.Fetch<Room2G_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -210,7 +210,7 @@ namespace ET
             this.UnitInfos.Clear();
             this.Frame = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -221,7 +221,7 @@ namespace ET
     {
         public static RoomManager2Room_Init Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(RoomManager2Room_Init), isFromPool) as RoomManager2Room_Init;
+            return ObjectPool.Fetch<RoomManager2Room_Init>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -240,7 +240,7 @@ namespace ET
             this.RpcId = default;
             this.PlayerIds.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -250,7 +250,7 @@ namespace ET
     {
         public static Room2RoomManager_Init Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2RoomManager_Init), isFromPool) as Room2RoomManager_Init;
+            return ObjectPool.Fetch<Room2RoomManager_Init>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -273,7 +273,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 24 - 24
Unity/Assets/Scripts/Model/Generate/Server/Message/LockStepOuter_C_11001.cs

@@ -10,7 +10,7 @@ namespace ET
     {
         public static C2G_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Match), isFromPool) as C2G_Match;
+            return ObjectPool.Fetch<C2G_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -25,7 +25,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -35,7 +35,7 @@ namespace ET
     {
         public static G2C_Match Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Match), isFromPool) as G2C_Match;
+            return ObjectPool.Fetch<G2C_Match>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -58,7 +58,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -71,7 +71,7 @@ namespace ET
     {
         public static Match2G_NotifyMatchSuccess Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Match2G_NotifyMatchSuccess), isFromPool) as Match2G_NotifyMatchSuccess;
+            return ObjectPool.Fetch<Match2G_NotifyMatchSuccess>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -93,7 +93,7 @@ namespace ET
             this.RpcId = default;
             this.ActorId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -106,7 +106,7 @@ namespace ET
     {
         public static C2Room_ChangeSceneFinish Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2Room_ChangeSceneFinish), isFromPool) as C2Room_ChangeSceneFinish;
+            return ObjectPool.Fetch<C2Room_ChangeSceneFinish>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -121,7 +121,7 @@ namespace ET
 
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -131,7 +131,7 @@ namespace ET
     {
         public static LockStepUnitInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(LockStepUnitInfo), isFromPool) as LockStepUnitInfo;
+            return ObjectPool.Fetch<LockStepUnitInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -154,7 +154,7 @@ namespace ET
             this.Position = default;
             this.Rotation = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -167,7 +167,7 @@ namespace ET
     {
         public static Room2C_Start Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_Start), isFromPool) as Room2C_Start;
+            return ObjectPool.Fetch<Room2C_Start>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -186,7 +186,7 @@ namespace ET
             this.StartTime = default;
             this.UnitInfo.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -196,7 +196,7 @@ namespace ET
     {
         public static FrameMessage Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(FrameMessage), isFromPool) as FrameMessage;
+            return ObjectPool.Fetch<FrameMessage>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -219,7 +219,7 @@ namespace ET
             this.PlayerId = default;
             this.Input = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -229,7 +229,7 @@ namespace ET
     {
         public static OneFrameInputs Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(OneFrameInputs), isFromPool) as OneFrameInputs;
+            return ObjectPool.Fetch<OneFrameInputs>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -248,7 +248,7 @@ namespace ET
             this.Frame = default;
             this.Inputs.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -258,7 +258,7 @@ namespace ET
     {
         public static Room2C_AdjustUpdateTime Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_AdjustUpdateTime), isFromPool) as Room2C_AdjustUpdateTime;
+            return ObjectPool.Fetch<Room2C_AdjustUpdateTime>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -273,7 +273,7 @@ namespace ET
 
             this.DiffTime = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -283,7 +283,7 @@ namespace ET
     {
         public static C2Room_CheckHash Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2Room_CheckHash), isFromPool) as C2Room_CheckHash;
+            return ObjectPool.Fetch<C2Room_CheckHash>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -306,7 +306,7 @@ namespace ET
             this.Frame = default;
             this.Hash = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -316,7 +316,7 @@ namespace ET
     {
         public static Room2C_CheckHashFail Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(Room2C_CheckHashFail), isFromPool) as Room2C_CheckHashFail;
+            return ObjectPool.Fetch<Room2C_CheckHashFail>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -335,7 +335,7 @@ namespace ET
             this.Frame = default;
             this.LSWorldBytes = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -345,7 +345,7 @@ namespace ET
     {
         public static G2C_Reconnect Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Reconnect), isFromPool) as G2C_Reconnect;
+            return ObjectPool.Fetch<G2C_Reconnect>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -368,7 +368,7 @@ namespace ET
             this.UnitInfos.Clear();
             this.Frame = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 68 - 68
Unity/Assets/Scripts/Model/Generate/Server/Message/OuterMessage_C_10001.cs

@@ -9,7 +9,7 @@ namespace ET
     {
         public static HttpGetRouterResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(HttpGetRouterResponse), isFromPool) as HttpGetRouterResponse;
+            return ObjectPool.Fetch<HttpGetRouterResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -28,7 +28,7 @@ namespace ET
             this.Realms.Clear();
             this.Routers.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -38,7 +38,7 @@ namespace ET
     {
         public static RouterSync Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(RouterSync), isFromPool) as RouterSync;
+            return ObjectPool.Fetch<RouterSync>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -57,7 +57,7 @@ namespace ET
             this.ConnectId = default;
             this.Address = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -68,7 +68,7 @@ namespace ET
     {
         public static C2M_TestRequest Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRequest), isFromPool) as C2M_TestRequest;
+            return ObjectPool.Fetch<C2M_TestRequest>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -87,7 +87,7 @@ namespace ET
             this.RpcId = default;
             this.request = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -97,7 +97,7 @@ namespace ET
     {
         public static M2C_TestResponse Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestResponse), isFromPool) as M2C_TestResponse;
+            return ObjectPool.Fetch<M2C_TestResponse>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -124,7 +124,7 @@ namespace ET
             this.Message = default;
             this.response = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -135,7 +135,7 @@ namespace ET
     {
         public static C2G_EnterMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_EnterMap), isFromPool) as C2G_EnterMap;
+            return ObjectPool.Fetch<C2G_EnterMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -150,7 +150,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -160,7 +160,7 @@ namespace ET
     {
         public static G2C_EnterMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_EnterMap), isFromPool) as G2C_EnterMap;
+            return ObjectPool.Fetch<G2C_EnterMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -190,7 +190,7 @@ namespace ET
             this.Message = default;
             this.MyId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -200,7 +200,7 @@ namespace ET
     {
         public static MoveInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(MoveInfo), isFromPool) as MoveInfo;
+            return ObjectPool.Fetch<MoveInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -223,7 +223,7 @@ namespace ET
             this.Rotation = default;
             this.TurnSpeed = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -233,7 +233,7 @@ namespace ET
     {
         public static UnitInfo Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(UnitInfo), isFromPool) as UnitInfo;
+            return ObjectPool.Fetch<UnitInfo>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -272,7 +272,7 @@ namespace ET
             this.KV.Clear();
             this.MoveInfo = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -282,7 +282,7 @@ namespace ET
     {
         public static M2C_CreateUnits Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_CreateUnits), isFromPool) as M2C_CreateUnits;
+            return ObjectPool.Fetch<M2C_CreateUnits>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -297,7 +297,7 @@ namespace ET
 
             this.Units.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -307,7 +307,7 @@ namespace ET
     {
         public static M2C_CreateMyUnit Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_CreateMyUnit), isFromPool) as M2C_CreateMyUnit;
+            return ObjectPool.Fetch<M2C_CreateMyUnit>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -322,7 +322,7 @@ namespace ET
 
             this.Unit = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -332,7 +332,7 @@ namespace ET
     {
         public static M2C_StartSceneChange Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_StartSceneChange), isFromPool) as M2C_StartSceneChange;
+            return ObjectPool.Fetch<M2C_StartSceneChange>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -351,7 +351,7 @@ namespace ET
             this.SceneInstanceId = default;
             this.SceneName = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -361,7 +361,7 @@ namespace ET
     {
         public static M2C_RemoveUnits Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_RemoveUnits), isFromPool) as M2C_RemoveUnits;
+            return ObjectPool.Fetch<M2C_RemoveUnits>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -376,7 +376,7 @@ namespace ET
 
             this.Units.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -386,7 +386,7 @@ namespace ET
     {
         public static C2M_PathfindingResult Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_PathfindingResult), isFromPool) as C2M_PathfindingResult;
+            return ObjectPool.Fetch<C2M_PathfindingResult>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -405,7 +405,7 @@ namespace ET
             this.RpcId = default;
             this.Position = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -415,7 +415,7 @@ namespace ET
     {
         public static C2M_Stop Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_Stop), isFromPool) as C2M_Stop;
+            return ObjectPool.Fetch<C2M_Stop>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -430,7 +430,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -440,7 +440,7 @@ namespace ET
     {
         public static M2C_PathfindingResult Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_PathfindingResult), isFromPool) as M2C_PathfindingResult;
+            return ObjectPool.Fetch<M2C_PathfindingResult>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -463,7 +463,7 @@ namespace ET
             this.Position = default;
             this.Points.Clear();
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -473,7 +473,7 @@ namespace ET
     {
         public static M2C_Stop Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_Stop), isFromPool) as M2C_Stop;
+            return ObjectPool.Fetch<M2C_Stop>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -500,7 +500,7 @@ namespace ET
             this.Position = default;
             this.Rotation = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -511,7 +511,7 @@ namespace ET
     {
         public static C2G_Ping Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Ping), isFromPool) as C2G_Ping;
+            return ObjectPool.Fetch<C2G_Ping>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -526,7 +526,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -536,7 +536,7 @@ namespace ET
     {
         public static G2C_Ping Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Ping), isFromPool) as G2C_Ping;
+            return ObjectPool.Fetch<G2C_Ping>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -563,7 +563,7 @@ namespace ET
             this.Message = default;
             this.Time = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -573,7 +573,7 @@ namespace ET
     {
         public static G2C_Test Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Test), isFromPool) as G2C_Test;
+            return ObjectPool.Fetch<G2C_Test>(isFromPool);
         }
 
         public override void Dispose()
@@ -584,7 +584,7 @@ namespace ET
             }
 
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -595,7 +595,7 @@ namespace ET
     {
         public static C2M_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_Reload), isFromPool) as C2M_Reload;
+            return ObjectPool.Fetch<C2M_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -618,7 +618,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -628,7 +628,7 @@ namespace ET
     {
         public static M2C_Reload Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_Reload), isFromPool) as M2C_Reload;
+            return ObjectPool.Fetch<M2C_Reload>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -651,7 +651,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -662,7 +662,7 @@ namespace ET
     {
         public static C2R_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2R_Login), isFromPool) as C2R_Login;
+            return ObjectPool.Fetch<C2R_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -691,7 +691,7 @@ namespace ET
             this.Account = default;
             this.Password = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -701,7 +701,7 @@ namespace ET
     {
         public static R2C_Login Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(R2C_Login), isFromPool) as R2C_Login;
+            return ObjectPool.Fetch<R2C_Login>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -736,7 +736,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -747,7 +747,7 @@ namespace ET
     {
         public static C2G_LoginGate Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_LoginGate), isFromPool) as C2G_LoginGate;
+            return ObjectPool.Fetch<C2G_LoginGate>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -773,7 +773,7 @@ namespace ET
             this.Key = default;
             this.GateId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -783,7 +783,7 @@ namespace ET
     {
         public static G2C_LoginGate Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_LoginGate), isFromPool) as G2C_LoginGate;
+            return ObjectPool.Fetch<G2C_LoginGate>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -810,7 +810,7 @@ namespace ET
             this.Message = default;
             this.PlayerId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -820,7 +820,7 @@ namespace ET
     {
         public static G2C_TestHotfixMessage Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_TestHotfixMessage), isFromPool) as G2C_TestHotfixMessage;
+            return ObjectPool.Fetch<G2C_TestHotfixMessage>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -835,7 +835,7 @@ namespace ET
 
             this.Info = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -846,7 +846,7 @@ namespace ET
     {
         public static C2M_TestRobotCase Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRobotCase), isFromPool) as C2M_TestRobotCase;
+            return ObjectPool.Fetch<C2M_TestRobotCase>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -865,7 +865,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -875,7 +875,7 @@ namespace ET
     {
         public static M2C_TestRobotCase Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestRobotCase), isFromPool) as M2C_TestRobotCase;
+            return ObjectPool.Fetch<M2C_TestRobotCase>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -902,7 +902,7 @@ namespace ET
             this.Message = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -912,7 +912,7 @@ namespace ET
     {
         public static C2M_TestRobotCase2 Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TestRobotCase2), isFromPool) as C2M_TestRobotCase2;
+            return ObjectPool.Fetch<C2M_TestRobotCase2>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -931,7 +931,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -941,7 +941,7 @@ namespace ET
     {
         public static M2C_TestRobotCase2 Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TestRobotCase2), isFromPool) as M2C_TestRobotCase2;
+            return ObjectPool.Fetch<M2C_TestRobotCase2>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -960,7 +960,7 @@ namespace ET
             this.RpcId = default;
             this.N = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -971,7 +971,7 @@ namespace ET
     {
         public static C2M_TransferMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2M_TransferMap), isFromPool) as C2M_TransferMap;
+            return ObjectPool.Fetch<C2M_TransferMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -986,7 +986,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -996,7 +996,7 @@ namespace ET
     {
         public static M2C_TransferMap Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(M2C_TransferMap), isFromPool) as M2C_TransferMap;
+            return ObjectPool.Fetch<M2C_TransferMap>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1019,7 +1019,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -1030,7 +1030,7 @@ namespace ET
     {
         public static C2G_Benchmark Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(C2G_Benchmark), isFromPool) as C2G_Benchmark;
+            return ObjectPool.Fetch<C2G_Benchmark>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1045,7 +1045,7 @@ namespace ET
 
             this.RpcId = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 
@@ -1055,7 +1055,7 @@ namespace ET
     {
         public static G2C_Benchmark Create(bool isFromPool = false)
         {
-            return ObjectPool.Instance.Fetch(typeof(G2C_Benchmark), isFromPool) as G2C_Benchmark;
+            return ObjectPool.Fetch<G2C_Benchmark>(isFromPool);
         }
 
         [MemoryPackOrder(0)]
@@ -1078,7 +1078,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
 
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
     }
 

+ 6 - 6
Unity/Assets/Scripts/Model/Server/Module/NetInner/A2NetInner_Message.cs

@@ -7,7 +7,7 @@ namespace ET
     {
         public static A2NetInner_Message Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(A2NetInner_Message)) as A2NetInner_Message;
+            return ObjectPool.Fetch(typeof(A2NetInner_Message)) as A2NetInner_Message;
         }
 
         public override void Dispose()
@@ -15,7 +15,7 @@ namespace ET
             this.FromAddress = default;
             this.ActorId = default;
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
         
         public Address FromAddress;
@@ -29,7 +29,7 @@ namespace ET
     {
         public static A2NetInner_Request Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(A2NetInner_Request)) as A2NetInner_Request;
+            return ObjectPool.Fetch(typeof(A2NetInner_Request)) as A2NetInner_Request;
         }
 
         public override void Dispose()
@@ -38,7 +38,7 @@ namespace ET
             this.ActorId = default;
             this.MessageObject = default;
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
         
         public int RpcId { get; set; }
@@ -51,7 +51,7 @@ namespace ET
     {
         public static A2NetInner_Response Create()
         {
-            return ObjectPool.Instance.Fetch(typeof(A2NetInner_Response)) as A2NetInner_Response;
+            return ObjectPool.Fetch(typeof(A2NetInner_Response)) as A2NetInner_Response;
         }
 
         public override void Dispose()
@@ -60,7 +60,7 @@ namespace ET
             this.Error = default;
             this.Message = default;
             
-            ObjectPool.Instance.Recycle(this);
+            ObjectPool.Recycle(this);
         }
         
         public int Error { get; set; }

+ 3 - 1
Unity/Assets/Scripts/Model/Share/Entry.cs

@@ -35,9 +35,11 @@
             
             // 注册Entity序列化器
             EntitySerializeRegister.Init();
+            
+            World.Instance.AddSingleton<ObjectPool>();
             World.Instance.AddSingleton<IdGenerater>();
             World.Instance.AddSingleton<OpcodeType>();
-            World.Instance.AddSingleton<ObjectPool>();
+            
             World.Instance.AddSingleton<MessageQueue>();
             World.Instance.AddSingleton<NetServices>();
             World.Instance.AddSingleton<NavmeshComponent>();

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/Message/MessageSessionHandler.cs

@@ -62,7 +62,7 @@ namespace ET
                 long instanceId = session.InstanceId;
 
                 // 这里用using很安全,因为后面是session发送出去了
-                using Response response = ObjectPool.Instance.Fetch<Response>();
+                using Response response = ObjectPool.Fetch<Response>();
                 try
                 {
                     await this.Run(session, request, response);