Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.1 SourceAsset performance and other improvements #39

Merged
merged 17 commits into from
Feb 19, 2025

Conversation

SkowronskiAndrew
Copy link
Contributor

@SkowronskiAndrew SkowronskiAndrew commented Feb 18, 2025

Backport fixes from an internal fork of BuildReportInspector

  • Foldout bug
  • Improve performance of SourceAssets tab and set a maximum list size. See issue 15 and issue 22
  • Show the type of build and build output location

Fix "Open last build report" behavior when BuildReport was already copied into project

Various improvements for code readability and maintenance (marking member variables, cleaning white space)
Hide two tabs that are never populated if it is an AssetBundle build.

Consolidate the documentation to avoid trying to maintain 3 cut and paste copies.

Drop support for versions older than 2019.3, to reduce the ifdef noise in the code.

TestProject
-Fix test project
-Add a player build script to make it easier to try out the "detailed build report" case
-Add a menu item for building AssetBundles (using recommended APIs for 2022.3 and beyond but including backward compatible equivalents for older versions)
-Add a few more assets so that the output is more interesting.

Testing
Tested using 2021.3 which is oldest LTS as well as 6.2 alpha.
Tested with Windows Standalone and Android.

Apply Visual Studio formatting
…ailedBuildReport

Some build inspector functionality requires a DetailedBuildReport, so add a simple build script that performs the build with that flag.
Remove support for versions older than 2019.3
Remove some of the #if statements that were kept only for very old versions of Unity
Backport fix by jonathanma from an internal fork of BuildReportInspector
"Some Foldout where not shown properly because they were clipped by an unnecessary scroll view."
Backporting code cleanup from internal fork.
Help distinguish local variables in methods.
Bring in fixes for the SourceAsset tab from an internal fork of the build report inspector.

-Set a maximum number of assets, if surpased it won't display (rather than letting Unity freeze)
-Collapse objects of the same type from the same asset together (tool tip shows the matching count)

-show the build type (Player versus assetbundle) available on newer versions of Unity.
-Show the build output path

-use yellow for errors because red text is pretty unreadable on the dark theme.

This should fix:
#15

And improve situation for:
#22

TestProject
Add a second scene with an audio file so that is a bit more content to see in the report.
Add another sprite.
Change build script to use the settings from the player window.
Note: So far cannot figure out how to include the audio in the build output, the audio module is getting stripped so the audio never makes it in.
The fix that landed from #30 has a flaw if the same build report is viewed more than once using the Window option.
Because the timestamp is the same and the file already exists it was leaving an extra file "Library/LastBuild.buildreport" in the import folder.

Fix it by checking if the file exists and just select the existing one if it is already present.

Also add some comments.
Collapse 3 cut and paste copies of the documentation
Make the .md file in the Documentation folder the only place that shows the UI, the other md files have quick summary and then point to that doc file.
Result of opening package manager windows in 2021.3, this seems to fix the issue of audio stripped out from player build.
Ideally we will split this up into multiple files, but for the moment use regions to make it easier to work with the code for each tab individually
Move a few things to put related code together.
Hide two tabs that are never displayed for AssetBundle builds
Put in a temporary workaround for absense of summary.buildType in older versions of Unity

Add a menu item for performing an AssetBundle build to the TestProject.  It demonstrates new recommended API and flags for 2022.3 and beyond but still works for 2021 case with a few workarounds.
@SkowronskiAndrew SkowronskiAndrew merged commit a6c6648 into master Feb 19, 2025
1 check passed
@SkowronskiAndrew SkowronskiAndrew deleted the backport-sourceasset-performance branch February 19, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant