Forráskód Böngészése

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

tanghai 2 éve
szülő
commit
a012a3a708
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      Unity/Assets/Scripts/Core/Entity/Entity.cs

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

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