Browse Source

Type.GetHashCode还是可能冲突,换成type.TypeHandle.Value.ToInt64(),type.TypeHandle.Value是个IntPtr,这样就不会冲突了

tanghai 2 năm trước cách đây
mục cha
commit
a012a3a708

+ 1 - 1
Unity/Assets/Scripts/Core/Entity/Entity.cs

@@ -922,7 +922,7 @@ namespace ET
 
 
         protected virtual long GetLongHashCode(Type type)
         protected virtual long GetLongHashCode(Type type)
         {
         {
-            return type.GetHashCode();
+            return type.TypeHandle.Value.ToInt64();
         }
         }
 
 
         public override void BeginInit()
         public override void BeginInit()