MoveUnusedAssetsBatchNumToPrev() public method

public MoveUnusedAssetsBatchNumToPrev ( ) : void
return void
Exemplo n.º 1
0
	public static void MoveUnusedAssetsBatchToPrev(BuildInfo buildInfo, FileFilterGroup filtersToUse)
	{
		if (buildInfo.UnusedAssetsBatchNum == 0)
		{
			return;
		}
		buildInfo.MoveUnusedAssetsBatchNumToPrev();
		RefreshUnusedAssetsBatch(buildInfo, filtersToUse);
	}
Exemplo n.º 2
0
	static void RefreshUnusedAssetsBatch(BuildInfo buildInfo, FileFilterGroup filtersToUse)
	{
		if (buildInfo.UnusedAssetsIncludedInCreation)
		{
			BRT_BuildReportWindow.GetValueMessage = "Getting list of unused assets...";

			List<BuildReportTool.SizePart> allUsed = buildInfo.UsedAssets.GetAllAsList();

			BuildReportTool.SizePart[] allUnused;
			BuildReportTool.SizePart[][] perCategoryUnused;

			BuildPlatform buildPlatform = GetBuildPlatformFromString(buildInfo.BuildType, buildInfo.BuildTargetUsed);


			allUnused = GetAllUnusedAssets(buildInfo.ScenesIncludedInProject, buildInfo.ScriptDLLs, buildInfo.ProjectAssetsPath, buildInfo.IncludedSvnInUnused, buildInfo.IncludedGitInUnused, buildPlatform, buildInfo.UnusedPrefabsIncludedInCreation, buildInfo.UnusedAssetsBatchNum, buildInfo.UnusedAssetsEntriesPerBatch, allUsed);

			if (allUnused != null && allUnused.Length > 0)
			{

				perCategoryUnused = SegregateAssetSizesPerCategory(allUnused, filtersToUse);

				AssetList.SortType previousUnusedSortType = buildInfo.UnusedAssets.CurrentSortType;
				AssetList.SortOrder previousUnusedSortOrder = buildInfo.UnusedAssets.CurrentSortOrder;

				buildInfo.UnusedAssets = new AssetList();
				buildInfo.UnusedAssets.Init(allUnused, perCategoryUnused, filtersToUse, previousUnusedSortType, previousUnusedSortOrder);
				buildInfo.UnusedAssets.PopulateImportedSizes();

				if (allUsed.Count != buildInfo.UsedAssets.AllCount)
				{
					// it means GetAllUnusedAssets() found new used assets
					// re-assign all used and re-sort
					BuildReportTool.SizePart[] newAllUsedArray = allUsed.ToArray();

					BuildReportTool.SizePart[][] newPerCategoryUsed = SegregateAssetSizesPerCategory(newAllUsedArray, filtersToUse);


					AssetList.SortType previousUsedSortType = buildInfo.UsedAssets.CurrentSortType;
					AssetList.SortOrder previousUsedSortOrder = buildInfo.UsedAssets.CurrentSortOrder;

					buildInfo.UsedAssets = new AssetList();
					buildInfo.UsedAssets.Init(newAllUsedArray, newPerCategoryUsed, filtersToUse, previousUsedSortType, previousUsedSortOrder);
					buildInfo.UsedAssets.PopulateImportedSizes();
				}
			}
			else
			{
				// no assets found. this only happens when we tried to move to next batch but it turns out to be  the last
				// so we move back
				buildInfo.MoveUnusedAssetsBatchNumToPrev();
			}


			BRT_BuildReportWindow.GetValueMessage = "";

			buildInfo.FlagOkToRefresh();
		}
	}
	static void RefreshUnusedAssetsBatch(BuildInfo buildInfo, FileFilterGroup filtersToUse)
	{
		if (buildInfo.UnusedAssetsIncludedInCreation)
		{
			BRT_BuildReportWindow.GetValueMessage = "Getting list of unused assets...";

			List<BuildReportTool.SizePart> allUsed = buildInfo.UsedAssets.GetAllAsList();

			BuildReportTool.SizePart[] allUnused;
			BuildReportTool.SizePart[][] perCategoryUnused;

			BuildPlatform buildPlatform = GetBuildPlatformFromString(buildInfo.BuildType, buildInfo.BuildTargetUsed);


			allUnused = GetAllUnusedAssets(buildInfo.ScenesIncludedInProject, buildInfo.ScriptDLLs, buildInfo.ProjectAssetsPath, buildInfo.IncludedSvnInUnused, buildInfo.IncludedGitInUnused, buildPlatform, buildInfo.UnusedPrefabsIncludedInCreation, buildInfo.UnusedAssetsBatchNum, buildInfo.UnusedAssetsEntriesPerBatch, allUsed);

			if (allUnused != null && allUnused.Length > 0)
			{
				perCategoryUnused = SegregateAssetSizesPerCategory(allUnused, filtersToUse);

				buildInfo.UnusedAssets = new AssetList();
				buildInfo.UnusedAssets.Init(allUnused, perCategoryUnused, filtersToUse);

				if (allUsed.Count != buildInfo.UsedAssets.AllCount)
				{
					// it means GetAllUnusedAssets() found new used assets
					// re-assign all used and re-sort
					BuildReportTool.SizePart[] newAllUsedArray = allUsed.ToArray();

					BuildReportTool.SizePart[][] newPerCategoryUsed = SegregateAssetSizesPerCategory(newAllUsedArray, filtersToUse);
					buildInfo.UsedAssets = new AssetList();
					buildInfo.UsedAssets.Init(newAllUsedArray, newPerCategoryUsed, filtersToUse);
				}
			}
			else
			{
				buildInfo.MoveUnusedAssetsBatchNumToPrev();
			}


			BRT_BuildReportWindow.GetValueMessage = "";

			buildInfo.FlagOkToRefresh();
		}
	}