コード例 #1
0
        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);
        }
コード例 #2
0
 public Type[] RemoveAdditionalDataComponentAndPropagateToComponent([DisallowNull] Type componentToRemove, [DisallowNull] Type[] componentsToAdd)
 {
     return(GenericRemoveComponent(m_GameObject, componentToRemove, componentsToAdd, c => RemoveAdditionalDataUtils.RemoveAdditionalData(c, false)));
 }