Merge branch 'bf' into dev

This commit is contained in:
DCFApixels 2024-12-21 15:11:39 +08:00
commit 074a0fab97
6 changed files with 18 additions and 9 deletions

View File

@ -10,7 +10,7 @@
<RootNamespace>DCFApixels.DragonECS</RootNamespace>
<Title>DragonECS</Title>
<Version>0.8.62</Version>
<Version>0.8.63</Version>
<Authors>DCFApixels</Authors>
<Description>ECS Framework for Game Engines with C# and .Net Platform</Description>
<Copyright>DCFApixels</Copyright>

View File

@ -1036,7 +1036,7 @@ public struct WorldComponent : IEcsWorldComponent<WorldComponent>
* [Классическая C# многопоточность](https://github.com/DCFApixels/DragonECS-ClassicThreads)
* [Recursivity](https://github.com/DCFApixels/DragonECS-Recursivity)
* [Hybrid](https://github.com/DCFApixels/DragonECS-Hybrid)
* Графы (Work in progress)
* [Графы](https://github.com/DCFApixels/DragonECS-Graphs)
* Утилиты:
* [Упрощенный синтаксис](https://gist.github.com/DCFApixels/d7bfbfb8cb70d141deff00be24f28ff0)
* [Однокадровые компоненты](https://gist.github.com/DCFApixels/46d512dbcf96c115b94c3af502461f60)

View File

@ -1003,7 +1003,7 @@ public struct WorldComponent : IEcsWorldComponent<WorldComponent>
* [经典C#多线程](https://github.com/DCFApixels/DragonECS-ClassicThreads)
* [Recursivity](https://github.com/DCFApixels/DragonECS-Recursivity)
* [Hybrid](https://github.com/DCFApixels/DragonECS-Hybrid)
* Graphs (Work in progress)
* [Graphs](https://github.com/DCFApixels/DragonECS-Graphs)
* Utilities:
* [简单语法](https://gist.github.com/DCFApixels/d7bfbfb8cb70d141deff00be24f28ff0)
* [单帧组件](https://gist.github.com/DCFApixels/46d512dbcf96c115b94c3af502461f60)

View File

@ -1008,7 +1008,7 @@ public struct WorldComponent : IEcsWorldComponent<WorldComponent>
* [Classic C# multithreading](https://github.com/DCFApixels/DragonECS-ClassicThreads)
* [Recursivity](https://github.com/DCFApixels/DragonECS-Recursivity)
* [Hybrid](https://github.com/DCFApixels/DragonECS-Hybrid)
* Graphs (Work in progress)
* [Graphs](https://github.com/DCFApixels/DragonECS-Graphs)
* Utilities:
* [Simple syntax](https://gist.github.com/DCFApixels/d7bfbfb8cb70d141deff00be24f28ff0)
* [One-Frame Components](https://gist.github.com/DCFApixels/46d512dbcf96c115b94c3af502461f60)

View File

@ -8,7 +8,7 @@
"displayName": "DragonECS",
"description": "C# Entity Component System Framework",
"unity": "2020.3",
"version": "0.8.62",
"version": "0.8.63",
"repository": {
"type": "git",
"url": "https://github.com/DCFApixels/DragonECS.git"

View File

@ -520,14 +520,23 @@ namespace DCFApixels.DragonECS
string id = atr.ID;
if (type.IsGenericType && type.IsGenericTypeDefinition == false)
{
id = $"{id}<{string.Join(", ", type.GetGenericArguments().Select(o => GetMetaID(o)))}>";
var metaIds = type.GetGenericArguments().Select(o => GetMetaID(o));
if(metaIds.Any(o => string.IsNullOrEmpty(o)))
{
id = string.Empty;
}
else
{
id = $"{id}<{string.Join(", ", metaIds)}>";
}
}
if (_idTypePairs.TryGetValue(id, out Type otherType) && type != otherType) //этот ексепшен не работает, так как атрибуты не кешируются а пересоздаются
if (string.IsNullOrEmpty(id) == false &&
_idTypePairs.TryGetValue(id, out Type otherType) && type != otherType)
{
Throw.Exception($"Types {type.ToMeta().TypeName} and {otherType.ToMeta().TypeName} have duplicate {atr.ID} MetaID.");
}
_idTypePairs[atr.ID] = type;
return atr.ID;
_idTypePairs[id] = type;
return id;
}
#else
EcsDebug.PrintWarning($"Reflection is not available, the {nameof(MetaGenerator)}.{nameof(GetMetaID)} method does not work.");