/// <summary> /// Call this method to run all the converters in a specific container in batch mode. /// </summary> /// <param name="containerName">The name of the container which will be batched. All Converters in this Container will run if prerequisites are met.</param> public static void RunInBatchMode(ConverterContainerId containerName) { Type typeName = GetContainerType(containerName); if (typeName != null) { RunInBatchMode(typeName); } }
static Type GetContainerType(ConverterContainerId containerName) { switch (containerName) { case ConverterContainerId.BuiltInToURP: return(typeof(BuiltInToURPConverterContainer)); case ConverterContainerId.BuiltInToURP2D: return(typeof(BuiltInToURP2DConverterContainer)); case ConverterContainerId.UpgradeURP2DAssets: return(typeof(UpgradeURP2DAssetsContainer)); } return(null); }
/// <summary> /// Call this method to run a specific list of converters in a specific container in batch mode. /// </summary> /// <param name="containerName">The name of the container which will be batched.</param> /// <param name="converterList">The list of converters that will be either included or excluded from batching. These converters need to be part of the passed in container for them to run.</param> /// <param name="converterFilter">The enum that decide if the list of converters will be included or excluded when batching.</param> public static void RunInBatchMode(ConverterContainerId containerName, List <ConverterId> converterList, ConverterFilter converterFilter) { Type containerType = GetContainerType(containerName); List <Type> converterTypes = new List <Type>(converterList.Count); foreach (ConverterId typeName in converterList) { var converterType = GetConverterType(typeName); if (containerType != null && !converterTypes.Contains(converterType)) { converterTypes.Add(converterType); } } if (containerType != null && converterTypes.Any()) { RunInBatchMode(containerType, converterTypes, converterFilter); } }