fix: universe object registration logic order fixed
This commit is contained in:
@@ -63,17 +63,17 @@ public class Universe : BaseEntity, IUniverse
|
|||||||
if (!universeObject.Initialize())
|
if (!universeObject.Initialize())
|
||||||
throw new Exception($"{universeObject.Name} can't be initialized");
|
throw new Exception($"{universeObject.Name} can't be initialized");
|
||||||
|
|
||||||
for (int i = 0; i < universeObject.Children.Count; i++)
|
|
||||||
Register(universeObject.Children[i]);
|
|
||||||
|
|
||||||
_universeObjects.Add(universeObject);
|
|
||||||
|
|
||||||
if (universeObject.Parent == null)
|
if (universeObject.Parent == null)
|
||||||
universeObject.Parent = Root;
|
universeObject.Parent = Root;
|
||||||
|
|
||||||
|
_universeObjects.Add(universeObject);
|
||||||
|
|
||||||
if (!universeObject.EnterUniverse(this))
|
if (!universeObject.EnterUniverse(this))
|
||||||
throw new Exception($"{universeObject.Name} can't enter the universe");
|
throw new Exception($"{universeObject.Name} can't enter the universe");
|
||||||
|
|
||||||
|
for (int i = 0; i < universeObject.Children.Count; i++)
|
||||||
|
Register(universeObject.Children[i]);
|
||||||
|
|
||||||
OnUniverseObjectRegistered?.Invoke(this, new(universeObject));
|
OnUniverseObjectRegistered?.Invoke(this, new(universeObject));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user