From 7deb0497699e14e326ba2ee597031f2af6a683ab Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Wed, 9 Aug 2023 11:09:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Entity=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=B3=9B=E5=9E=8B=E8=8E=B7=E5=8F=96=E7=88=B6=E7=BA=A7=E3=80=81?= =?UTF-8?q?Define=E5=A2=9E=E5=8A=A0unit[]=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新Entity接口 泛型获取父级、Define增加unit[]类型 --- Assets/GameScripts/DotNet/Core/Define.cs | 2 +- Assets/GameScripts/DotNet/Core/Entitas/Entity.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/GameScripts/DotNet/Core/Define.cs b/Assets/GameScripts/DotNet/Core/Define.cs index 9bb0b606..314be151 100644 --- a/Assets/GameScripts/DotNet/Core/Define.cs +++ b/Assets/GameScripts/DotNet/Core/Define.cs @@ -80,7 +80,7 @@ public static class Define { "", "0", "bool", "byte", "short", "ushort", "int", "uint", "long", "ulong", "float", "string", "AttrConfig", "IntDictionaryConfig", "StringDictionaryConfig", - "short[]", "int[]", "long[]", "float[]", "string[]" + "short[]", "int[]", "long[]", "float[]", "string[]","uint[]" }; /// /// Excel生成代码模板的位置 diff --git a/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs b/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs index fae76067..b627633e 100644 --- a/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs +++ b/Assets/GameScripts/DotNet/Core/Entitas/Entity.cs @@ -450,6 +450,11 @@ namespace TEngine #endif #region GetComponent + public T GetParent() where T : Entity, new() + { + return (T)Parent; + } + public T GetComponent() where T : Entity, new() { return GetComponent(typeof(T)) as T;