@@ -50,9 +50,9 @@ public void Add(EcsID parentId, EcsID childId)
5050 _parentsToChildren . Add ( parentId , children ) ;
5151
5252 _world . Set ( parentId , new TChildrenComponent ( ) { Value = children } ) ;
53- _world . Add < TParentComponent > ( parentId ) ;
5453 }
5554
55+ _world . Add < TParentComponent > ( childId ) ;
5656 children . Add ( childId ) ;
5757 }
5858
@@ -71,6 +71,7 @@ private bool RemoveChild(EcsID childId)
7171 // update children list on parent
7272 if ( _parentsToChildren . TryGetValue ( parentId , out var children ) )
7373 {
74+ _world . Unset < TParentComponent > ( childId ) ;
7475 children . Remove ( childId ) ;
7576 if ( children . Count == 0 )
7677 RemoveParent ( parentId ) ;
@@ -94,6 +95,7 @@ private bool RemoveParent(EcsID parentId)
9495
9596 // if child is a parent, remove associated children too
9697 RemoveParent ( id ) ;
98+ _world . Unset < TParentComponent > ( id ) ;
9799 }
98100
99101 children . Clear ( ) ;
@@ -129,7 +131,7 @@ internal RelationshipEntityMapper(World world) : base(world, CleanupPolicy.Delet
129131
130132public sealed class NamingEntityMapper
131133{
132- private readonly Dictionary < string , EcsID > _names = new ( ) ;
134+ private readonly Dictionary < string , EcsID > _names = new ( ) ;
133135 private readonly Dictionary < EcsID , string > _entitiesWithName = new ( ) ;
134136 private readonly World _world ;
135137
@@ -231,7 +233,7 @@ public struct Children : IChildrenComponent
231233
232234 private HashSet < EcsID > _value ;
233235
234- HashSet < ulong > IChildrenComponent . Value
236+ HashSet < ulong > IChildrenComponent . Value
235237 {
236238 readonly get => _value ;
237239 set => _value = value ;
0 commit comments