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

"Embed Package" option doesn't appear to work with hosted packages #2

Open
randomPoison opened this issue Jun 29, 2020 · 1 comment

Comments

@randomPoison
Copy link

Hello! I'm trying to use this utility to embed a copy of the Addressables package in my project in order to more easily examine the Addressables source code. Based on the description of this project, I thought I could use it for this case. However, when I try to use the "Embed Package" option on Addressables, it appears to be disabled:

image

This also appears to be the case for all hosted packages in my project.

I'm seeing this in Unity 2019.3.11f1 on Windows 10.


This appears to be an issue with the call to Path.GetDirectoryName() used to determine if the selected directory is a valid. Testing it on my computer, the asset path returned by the call to AssetDatabase.GetAssetPath() will be something like

Packages/com.unity.addressables/package.json

so GetDirectoryName() ends up returning

Packages/com.unity.addressables

This causes the check for folder == "Packages" to return false. It seems like a solution is to repeatedly call GetDirectoryName() to strip the directory names until you get the root directory in the path (at least, I haven't found a cleaner solution for this yet).

I'm working on getting a pull request up to fix this, but please let me know if I'm missing anything or if it's intended that the "Embed Package" button doesn't work in the case I described!

@MuhammadFaizanKhan
Copy link

I am getting this error! Did you find the solution.

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 a pull request may close this issue.

2 participants