private void onSplittableObjectChildrenSplit(SplittableObject splittableObject) { ManipulatableObject component = splittableObject.GetComponent <ManipulatableObject>(); CollidableObject component2 = splittableObject.GetComponent <CollidableObject>(); int nextAvailable = numberTracker.GetNextAvailable(); GameObject[] splitList = splittableObject.SplitList; foreach (GameObject gameObject in splitList) { CollidableObject collidableObject = gameObject.AddComponent <CollidableObject>(); collidableObject.CollisionRuleSet = component2.CollisionRuleSet; ManipulatableObject manipulatableObject = gameObject.AddComponent <ManipulatableObject>(); gameObject.AddComponent <ManipulatableObjectEffects>(); if (component != null) { manipulatableObject.DefinitionId = component.DefinitionId; } if (this.ObjectAdded != null) { this.ObjectAdded.InvokeSafe(manipulatableObject); } PartneredObject component3 = gameObject.GetComponent <PartneredObject>(); if (component3 != null) { component3.SetOthers(splittableObject.SplitList); component3.SetNumber(nextAvailable); } UpdateLayoutForManipulatableObject(sceneLayoutContainer, manipulatableObject); manipulatableObject.SetParent(sceneLayoutContainer); manipulatableObject.OnRemoved += onObjectRemoved; manipulatableObject.BeforeParentChanged += onBeforeManipulatableObjectReParented; manipulatableObject.AfterParentChanged += onAfterManipulatableObjectReParented; } component.RemoveObject(deleteChildren: false); splittableObject.ChildrenSplit -= onSplittableObjectChildrenSplit; }