コード例 #1
0
        internal static void RemoveAdditionalDataComponent([DisallowNull] Component additionalDataComponent, [DisallowNull] List <Type> componentsTypeToRemove)
        {
            using (ListPool <Component> .Get(out var components))
            {
                // Fetch all components
                foreach (var type in componentsTypeToRemove)
                {
                    components.AddRange(additionalDataComponent.GetComponents(type));
                }

                // Remove all of them
                foreach (var mono in components)
                {
                    RemoveComponentUtils.RemoveComponent(mono);
                }
            }
        }
コード例 #2
0
 static void RemoveComponentWithAdditionalData(MenuCommand command)
 {
     RemoveComponentUtils.RemoveComponent(command.context as Component);
 }