You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project folder includes a 'Packages' subfolder now to see the contents of installed packages.
The path it reports with AssetDatabase.GetAssetPath isn't where the actual package items are stored, so when doubleclicking a script in a package VSCode opens a new blank file with unsaved changes instead of viewing the actual contents of the script.
To get it working for me, I've replaced string completeFilepath = appPath + Path.DirectorySeparatorChar + AssetDatabase.GetAssetPath(selected);
with string completeFilepath = Path.GetFullPath(selectedFilePath);
in the OnOpenedAsset callback.
The text was updated successfully, but these errors were encountered:
The project folder includes a 'Packages' subfolder now to see the contents of installed packages.
The path it reports with AssetDatabase.GetAssetPath isn't where the actual package items are stored, so when doubleclicking a script in a package VSCode opens a new blank file with unsaved changes instead of viewing the actual contents of the script.
To get the path where the item exists (the one that opens when you right click and choose 'Show in Explorer'), the Path.GetFullPath() method can be used as per https://docs.unity3d.com/Manual/upm-assets.html#GetFullPath
To get it working for me, I've replaced
string completeFilepath = appPath + Path.DirectorySeparatorChar + AssetDatabase.GetAssetPath(selected);
with
string completeFilepath = Path.GetFullPath(selectedFilePath);
in the OnOpenedAsset callback.
The text was updated successfully, but these errors were encountered: