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> <RootNamespace>DCFApixels.DragonECS</RootNamespace>
<Title>DragonECS</Title> <Title>DragonECS</Title>
<Version>0.8.62</Version> <Version>0.8.63</Version>
<Authors>DCFApixels</Authors> <Authors>DCFApixels</Authors>
<Description>ECS Framework for Game Engines with C# and .Net Platform</Description> <Description>ECS Framework for Game Engines with C# and .Net Platform</Description>
<Copyright>DCFApixels</Copyright> <Copyright>DCFApixels</Copyright>

View File

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

View File

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

View File

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

View File

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