code cleanup

This commit is contained in:
DCFApixels 2025-04-19 11:06:17 +08:00
parent 67477ef90d
commit 8418c81e34
8 changed files with 22 additions and 22 deletions

View File

@ -78,7 +78,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
entlong ent = default; entlong ent = default;
bool isValide = false; bool isValide = false;
var dragged = DragAndDrop.objectReferences[0]; var dragged = DragAndDrop.objectReferences[0];
if(dragged is GameObject go) if (dragged is GameObject go)
{ {
if (go.TryGetComponent(out EcsEntityConnect connect)) if (go.TryGetComponent(out EcsEntityConnect connect))
{ {
@ -104,8 +104,8 @@ namespace DCFApixels.DragonECS.Unity.Editors
isValide = true; isValide = true;
} }
} }
if(isValide) if (isValide)
{ {
long entityLong = *(long*)&ent; long entityLong = *(long*)&ent;
fulleProperty.longValue = entityLong; fulleProperty.longValue = entityLong;

View File

@ -333,7 +333,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
var x = Group.Splited.GetEnumerator(); var x = Group.Splited.GetEnumerator();
x.MoveNext(); x.MoveNext();
return x.Current.GetHashCode() ^ state; return x.Current.GetHashCode() ^ state;
}; }
} }
} }
#endregion #endregion

View File

@ -5,7 +5,7 @@ namespace DCFApixels.DragonECS.Unity.Internal
{ {
internal readonly struct ReadOnlyList<T> : IEnumerable<T>, IReadOnlyList<T> internal readonly struct ReadOnlyList<T> : IEnumerable<T>, IReadOnlyList<T>
{ {
private readonly List<T> _list; private readonly List<T> _list;
public ReadOnlyList(List<T> list) public ReadOnlyList(List<T> list)
{ {
_list = list; _list = list;

View File

@ -62,7 +62,7 @@ namespace DCFApixels.DragonECS.Unity.Internal
state ^= state >> 17; state ^= state >> 17;
state ^= state << 5; state ^= state << 5;
return state; return state;
}; }
} }
public static void DebugRect_Editor(params Rect[] rects) public static void DebugRect_Editor(params Rect[] rects)
{ {

View File

@ -249,17 +249,17 @@ namespace DCFApixels.DragonECS.Unity.Internal
self._items[index] = item; self._items[index] = item;
} }
// [MethodImpl(MethodImplOptions.AggressiveInlining)] // [MethodImpl(MethodImplOptions.AggressiveInlining)]
// public static bool TryDequeue_MultiAccess<T>(this ref StructList<T> self, T item) // public static bool TryDequeue_MultiAccess<T>(this ref StructList<T> self, T item)
// { // {
// var index = Interlocked.Increment(ref self._count); // var index = Interlocked.Increment(ref self._count);
// //
//#if DEBUG //#if DEBUG
// if (_count <= 0) { Throw.ArgumentOutOfRange(); } // if (_count <= 0) { Throw.ArgumentOutOfRange(); }
//#endif //#endif
// T result = _items[--_count]; // T result = _items[--_count];
// _items[_count] = default; // _items[_count] = default;
// return result; // return result;
// } // }
} }
} }

View File

@ -43,7 +43,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
break; break;
} }
} }
private void DrawScriptsCache() private void DrawScriptsCache()
{ {
if (GUILayout.Button("Reset")) if (GUILayout.Button("Reset"))

View File

@ -34,7 +34,7 @@ namespace DCFApixels.DragonECS.Unity.RefRepairer.Editors
public bool TryGetMetaID(TypeData key, out string metaID) public bool TryGetMetaID(TypeData key, out string metaID)
{ {
bool result = _typeKeyMetaIDPairs.TryGetValue(key, out metaID); bool result = _typeKeyMetaIDPairs.TryGetValue(key, out metaID);
if(result && string.IsNullOrEmpty(metaID)) if (result && string.IsNullOrEmpty(metaID))
{ {
result = false; result = false;
_typeKeyMetaIDPairs.Remove(key); _typeKeyMetaIDPairs.Remove(key);

View File

@ -79,12 +79,12 @@ namespace DCFApixels.DragonECS.Unity.RefRepairer.Internal
AssemblyName == other.AssemblyName; AssemblyName == other.AssemblyName;
} }
public override bool Equals(object obj) { return Equals((TypeData)obj); } public override bool Equals(object obj) { return Equals((TypeData)obj); }
public override int GetHashCode() public override int GetHashCode()
{ {
int hash1 = ClassName.GetHashCode(); int hash1 = ClassName.GetHashCode();
int hash2 = NamespaceName.GetHashCode(); int hash2 = NamespaceName.GetHashCode();
int hash3 = AssemblyName.GetHashCode(); int hash3 = AssemblyName.GetHashCode();
return hash1 ^ hash2 ^ hash3; return hash1 ^ hash2 ^ hash3;
} }
public override string ToString() { return $"{{{AssemblyName}, {NamespaceName}, {ClassName}}}"; } public override string ToString() { return $"{{{AssemblyName}, {NamespaceName}, {ClassName}}}"; }
} }