Skip to content

Fix for selecting correct classdatabasefile for closest Unity version… #59

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

Open
wants to merge 1 commit into
base: assetstoolsv2
Choose a base branch
from

Conversation

wh0am15533
Copy link

Here that PR you requested for AssetsView selecting the correct ClassDatabaseFile for the closest Unity version instead of just select the last one which will alway's be Unity 5.4.x

Copy link
Owner

@nesrak1 nesrak1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize, I wrote comments a while ago but forgot to submit the review.

//may still not work but better than nothing I guess
//in the future we should probably do a selector
//like uabe does
// Modification to find closest Unity version match
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to put this inside of LoadClassDatabaseFromPackage, that way it works everywhere rather than just here in AssetsView. It needs to be in a different method than LoadAssetsFile anyway.

List<ClassDatabaseFile> files = helper.classPackage.files;

// Filter all classDbFiles for matching versions
var unityMajMinVer = inst.file.typeTree.unityVersion.Substring(0, 6);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful about using substring like this since the length of major+minor versions aren't always 6 (for example, 5.0.0f1 first 6 characters are 5.0.0f not 5.0) Just use split for everything so we're sure it's correct.

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.

2 participants