更新Entity接口 泛型获取父级、Define增加unit[]类型

更新Entity接口 泛型获取父级、Define增加unit[]类型
This commit is contained in:
ALEXTANG
2023-08-09 11:09:38 +08:00
parent fce8bd4d60
commit 7deb049769
2 changed files with 6 additions and 1 deletions

View File

@@ -80,7 +80,7 @@ public static class Define
{ {
"", "0", "bool", "byte", "short", "ushort", "int", "uint", "long", "ulong", "float", "string", "AttrConfig", "", "0", "bool", "byte", "short", "ushort", "int", "uint", "long", "ulong", "float", "string", "AttrConfig",
"IntDictionaryConfig", "StringDictionaryConfig", "IntDictionaryConfig", "StringDictionaryConfig",
"short[]", "int[]", "long[]", "float[]", "string[]" "short[]", "int[]", "long[]", "float[]", "string[]","uint[]"
}; };
/// <summary> /// <summary>
/// Excel生成代码模板的位置 /// Excel生成代码模板的位置

View File

@@ -450,6 +450,11 @@ namespace TEngine
#endif #endif
#region GetComponent #region GetComponent
public T GetParent<T>() where T : Entity, new()
{
return (T)Parent;
}
public T GetComponent<T>() where T : Entity, new() public T GetComponent<T>() where T : Entity, new()
{ {
return GetComponent(typeof(T)) as T; return GetComponent(typeof(T)) as T;