|
|
@@ -173,18 +173,18 @@ namespace ET
|
|
|
{
|
|
|
if (value == null)
|
|
|
{
|
|
|
- throw new Exception($"cant set parent null: {this.GetType().Name}");
|
|
|
+ throw new Exception($"cant set parent null: {this.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
if (value == this)
|
|
|
{
|
|
|
- throw new Exception($"cant set parent self: {this.GetType().Name}");
|
|
|
+ throw new Exception($"cant set parent self: {this.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
// 严格限制parent必须要有domain,也就是说parent必须在数据树上面
|
|
|
if (value.Domain == null)
|
|
|
{
|
|
|
- throw new Exception($"cant set parent because parent domain is null: {this.GetType().Name} {value.GetType().Name}");
|
|
|
+ throw new Exception($"cant set parent because parent domain is null: {this.GetType().FullName} {value.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
if (this.parent != null) // 之前有parent
|
|
|
@@ -192,7 +192,7 @@ namespace ET
|
|
|
// parent相同,不设置
|
|
|
if (this.parent == value)
|
|
|
{
|
|
|
- Log.Error($"重复设置了Parent: {this.GetType().Name} parent: {this.parent.GetType().Name}");
|
|
|
+ Log.Error($"重复设置了Parent: {this.GetType().FullName} parent: {this.parent.GetType().FullName}");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -229,18 +229,18 @@ namespace ET
|
|
|
{
|
|
|
if (value == null)
|
|
|
{
|
|
|
- throw new Exception($"cant set parent null: {this.GetType().Name}");
|
|
|
+ throw new Exception($"cant set parent null: {this.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
if (value == this)
|
|
|
{
|
|
|
- throw new Exception($"cant set parent self: {this.GetType().Name}");
|
|
|
+ throw new Exception($"cant set parent self: {this.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
// 严格限制parent必须要有domain,也就是说parent必须在数据树上面
|
|
|
if (value.Domain == null)
|
|
|
{
|
|
|
- throw new Exception($"cant set parent because parent domain is null: {this.GetType().Name} {value.GetType().Name}");
|
|
|
+ throw new Exception($"cant set parent because parent domain is null: {this.GetType().FullName} {value.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
if (this.parent != null) // 之前有parent
|
|
|
@@ -248,7 +248,7 @@ namespace ET
|
|
|
// parent相同,不设置
|
|
|
if (this.parent == value)
|
|
|
{
|
|
|
- Log.Error($"重复设置了Parent: {this.GetType().Name} parent: {this.parent.GetType().Name}");
|
|
|
+ Log.Error($"重复设置了Parent: {this.GetType().FullName} parent: {this.parent.GetType().FullName}");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -287,7 +287,7 @@ namespace ET
|
|
|
{
|
|
|
if (value == null)
|
|
|
{
|
|
|
- throw new Exception($"domain cant set null: {this.GetType().Name}");
|
|
|
+ throw new Exception($"domain cant set null: {this.GetType().FullName}");
|
|
|
}
|
|
|
|
|
|
if (this.domain == value)
|
|
|
@@ -313,7 +313,7 @@ namespace ET
|
|
|
foreach (Entity component in this.componentsDB)
|
|
|
{
|
|
|
component.IsComponent = true;
|
|
|
- this.Components.Add(component.GetType().Name, component);
|
|
|
+ this.Components.Add(component.GetType().FullName, component);
|
|
|
component.parent = this;
|
|
|
}
|
|
|
}
|
|
|
@@ -499,7 +499,7 @@ namespace ET
|
|
|
|
|
|
private void AddToComponents(Entity component)
|
|
|
{
|
|
|
- this.Components.Add(component.GetType().Name, component);
|
|
|
+ this.Components.Add(component.GetType().FullName, component);
|
|
|
}
|
|
|
|
|
|
private void RemoveFromComponents(Entity component)
|
|
|
@@ -509,7 +509,7 @@ namespace ET
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this.components.Remove(component.GetType().Name);
|
|
|
+ this.components.Remove(component.GetType().FullName);
|
|
|
|
|
|
if (this.components.Count == 0)
|
|
|
{
|
|
|
@@ -620,7 +620,7 @@ namespace ET
|
|
|
}
|
|
|
|
|
|
Entity component;
|
|
|
- if (!this.components.TryGetValue(typeof (K).Name, out component))
|
|
|
+ if (!this.components.TryGetValue(typeof (K).FullName, out component))
|
|
|
{
|
|
|
return default;
|
|
|
}
|
|
|
@@ -642,7 +642,7 @@ namespace ET
|
|
|
}
|
|
|
|
|
|
Entity component;
|
|
|
- if (!this.components.TryGetValue(type.Name, out component))
|
|
|
+ if (!this.components.TryGetValue(type.FullName, out component))
|
|
|
{
|
|
|
return null;
|
|
|
}
|
|
|
@@ -678,7 +678,7 @@ namespace ET
|
|
|
public Entity AddComponent(Entity component)
|
|
|
{
|
|
|
Type type = component.GetType();
|
|
|
- if (this.components != null && this.components.ContainsKey(type.Name))
|
|
|
+ if (this.components != null && this.components.ContainsKey(type.FullName))
|
|
|
{
|
|
|
throw new Exception($"entity already has component: {type.FullName}");
|
|
|
}
|
|
|
@@ -695,7 +695,7 @@ namespace ET
|
|
|
|
|
|
public Entity AddComponent(Type type, bool isFromPool = false)
|
|
|
{
|
|
|
- if (this.components != null && this.components.ContainsKey(type.Name))
|
|
|
+ if (this.components != null && this.components.ContainsKey(type.FullName))
|
|
|
{
|
|
|
throw new Exception($"entity already has component: {type.FullName}");
|
|
|
}
|
|
|
@@ -716,7 +716,7 @@ namespace ET
|
|
|
public K AddComponentWithId<K>(long id, bool isFromPool = false) where K : Entity, IAwake, new()
|
|
|
{
|
|
|
Type type = typeof (K);
|
|
|
- if (this.components != null && this.components.ContainsKey(type.Name))
|
|
|
+ if (this.components != null && this.components.ContainsKey(type.FullName))
|
|
|
{
|
|
|
throw new Exception($"entity already has component: {type.FullName}");
|
|
|
}
|
|
|
@@ -737,7 +737,7 @@ namespace ET
|
|
|
public K AddComponentWithId<K, P1>(long id, P1 p1, bool isFromPool = false) where K : Entity, IAwake<P1>, new()
|
|
|
{
|
|
|
Type type = typeof (K);
|
|
|
- if (this.components != null && this.components.ContainsKey(type.Name))
|
|
|
+ if (this.components != null && this.components.ContainsKey(type.FullName))
|
|
|
{
|
|
|
throw new Exception($"entity already has component: {type.FullName}");
|
|
|
}
|
|
|
@@ -758,7 +758,7 @@ namespace ET
|
|
|
public K AddComponentWithId<K, P1, P2>(long id, P1 p1, P2 p2, bool isFromPool = false) where K : Entity, IAwake<P1, P2>, new()
|
|
|
{
|
|
|
Type type = typeof (K);
|
|
|
- if (this.components != null && this.components.ContainsKey(type.Name))
|
|
|
+ if (this.components != null && this.components.ContainsKey(type.FullName))
|
|
|
{
|
|
|
throw new Exception($"entity already has component: {type.FullName}");
|
|
|
}
|
|
|
@@ -779,7 +779,7 @@ namespace ET
|
|
|
public K AddComponentWithId<K, P1, P2, P3>(long id, P1 p1, P2 p2, P3 p3, bool isFromPool = false) where K : Entity, IAwake<P1, P2, P3>, new()
|
|
|
{
|
|
|
Type type = typeof (K);
|
|
|
- if (this.components != null && this.components.ContainsKey(type.Name))
|
|
|
+ if (this.components != null && this.components.ContainsKey(type.FullName))
|
|
|
{
|
|
|
throw new Exception($"entity already has component: {type.FullName}");
|
|
|
}
|