internal void FillBatch(ref IncrementalConversionBatch batch)
 {
     batch.DeletedInstanceIds            = DeletedInstanceIds.AsArray();
     batch.ChangedInstanceIds            = ChangedInstanceIds.ToNativeArray(Allocator.Temp);
     batch.ReconvertHierarchyInstanceIds = ReconvertHierarchyInstanceIds.ToNativeArray(Allocator.Temp);
     batch.ParentChangeInstanceIds       = ParentChangeInstanceIds;
     batch.ChangedAssets     = ChangedAssets.AsArray();
     batch.DeletedAssets     = DeletedAssets.AsArray();
     batch.ChangedComponents = ValidComponents;
     ValidComponents.AddRange(ComponentChanges);
 }
Ejemplo n.º 2
0
        internal static void ConvertIncremental(World conversionWorld, IEnumerable <GameObject> gameObjects, NativeList <int> changedAssetInstanceIds, ConversionFlags flags)
        {
#if UNITY_2020_2_OR_NEWER
            var args = new IncrementalConversionBatch
            {
                ReconvertHierarchyInstanceIds = new NativeArray <int>(gameObjects.Select(go => go.GetInstanceID()).ToArray(), Allocator.TempJob),
                ChangedComponents             = new List <Component>()
            };
            if (changedAssetInstanceIds.IsCreated)
            {
                args.ChangedAssets = changedAssetInstanceIds;
            }
            ConvertIncremental(conversionWorld, flags, ref args);
            args.ReconvertHierarchyInstanceIds.Dispose();
#else
            using (var conversion = new Conversion(conversionWorld))
            {
                conversion.MappingSystem.PrepareIncrementalConversion(gameObjects, changedAssetInstanceIds, flags);
                FinishConvertIncremental(conversionWorld, conversion);
            }
#endif
        }
Ejemplo n.º 3
0
        internal static void ConvertIncremental(World conversionWorld, ConversionFlags flags, ref IncrementalConversionBatch batch)
        {
            using (var conversion = new Conversion(conversionWorld))
            {
                conversion.MappingSystem.BeginIncrementalConversionPreparation(flags, ref batch);
                conversionWorld.GetExistingSystem <ConversionSetupGroup>().Update();
                conversion.MappingSystem.FinishIncrementalConversionPreparation();

                FinishConvertIncremental(conversionWorld, conversion);
            }
        }