public string[] TryGetComponentsToRemove([DisallowNull] Type type) { string[] result = Array.Empty <string>(); var additionalData = m_GameObject.AddComponent(type) as IAdditionalData; using (ListPool <Type> .Get(out var componentsToRemove)) { if (RemoveAdditionalDataUtils.TryGetComponentsToRemove(additionalData, componentsToRemove, out var error)) { result = componentsToRemove.Select(t => t.Name).ToArray(); } } return(result); }
public Type[] RemoveAdditionalDataComponentAndPropagateToComponent([DisallowNull] Type componentToRemove, [DisallowNull] Type[] componentsToAdd) { return(GenericRemoveComponent(m_GameObject, componentToRemove, componentsToAdd, c => RemoveAdditionalDataUtils.RemoveAdditionalData(c, false))); }