private void AddToSelectable(Component parentSelectableComponent) { _selectable.transform.SetParent(parentSelectableComponent.transform, true); object thisSelectable = _selectable.GetComponent(SelectableType); object parentSelectable = parentSelectableComponent.GetComponent(SelectableType); ParentField.SetValue(thisSelectable, parentSelectable); Array parentChildren = (Array)ChildrenField.GetValue(parentSelectable); Array newParentChildren = Array.CreateInstance(SelectableType, parentChildren.Length + 1); Array.Copy(parentChildren, newParentChildren, holdableChildIndex); newParentChildren.SetValue(thisSelectable, holdableChildIndex); Array.Copy(parentChildren, holdableChildIndex, newParentChildren, holdableChildIndex + 1, parentChildren.Length - holdableChildIndex); ChildrenField.SetValue(parentSelectable, newParentChildren); ChildRowLengthField.SetValue(parentSelectable, ((int)ChildRowLengthField.GetValue(parentSelectable)) + 1); InitMethod.Invoke(parentSelectable, null); InputHelper.InvokeConfigureSelectableAreas(parentSelectableComponent); }