Skip to content

Commit

Permalink
fix: Prevent error while export in root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
yapetrichka committed Aug 3, 2024
1 parent d88fac2 commit 5b6a129
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.8.3] - 2024-08-03
- Prevent error while export in root `Assets` folder
- Add installation guide

## [0.8.1] - 2023-02-24
- Prevent error CS0518: Predefined type 'System.Range'

Expand Down
6 changes: 4 additions & 2 deletions Editor/Reflection/PackageUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ internal static object[] ExtractAndPrepareAssetList(string selectedFolder, strin
{
var exportedAssetPath = (string)exportedAssetPathFieldInfo.GetValue(asset);
var existingAssetPath = (string)existingAssetPathFieldInfo.GetValue(asset);
var destinationPathWithoutRoot =
exportedAssetPath.Substring(exportedAssetPath.IndexOf("/", StringComparison.Ordinal));
var startIndex = exportedAssetPath.IndexOf("/", StringComparison.Ordinal);
if (startIndex == -1)
continue;
var destinationPathWithoutRoot = exportedAssetPath.Substring(startIndex);
var resultPath = selectedFolder + destinationPathWithoutRoot;
if (!string.IsNullOrEmpty(existingAssetPath) && !existingAssetPath.Equals(resultPath))
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.dreamcode.editor.smart-importer",
"displayName": "SmartImporter",
"version": "0.8.2",
"version": "0.8.3",
"unity": "2020.3",
"description": "Allows import Unity packages (.unitypackage) to custom folder, ignoring initial assets paths.",
"keywords": [
Expand Down

0 comments on commit 5b6a129

Please sign in to comment.