Skip to content

Commit 45cac7c

Browse files
committed
fix: update data path
1 parent 0a62cd5 commit 45cac7c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Editor/SOVariant.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public void LoadData(T targetObject)
231231
_SOVariantProperlyLoaded = false;
232232
return (null, null, null, null);;
233233
case (2):
234-
return ExtractData(ReadUpdatedMetaFile(data));
234+
return ExtractData(ReadUpdatedMetaFile(data, AssetDatabase.GetAssetPath(_target), _import));
235235
}
236236
}
237237
return (null, null, null, null);
@@ -479,7 +479,7 @@ private bool CheckForUserDataAndOverride(AssetImporter importer, string oldData,
479479
Debug.Log($"UserData in File \"{importer.assetPath}.meta\" not overwritten.");
480480
return false;
481481
case (2):
482-
string newOldData = ReadUpdatedMetaFile(oldData);
482+
string newOldData = ReadUpdatedMetaFile(oldData, importer.assetPath, importer);
483483
return CheckForUserDataAndOverride(importer, newOldData, newData);
484484
}
485485
}
@@ -488,9 +488,9 @@ private bool CheckForUserDataAndOverride(AssetImporter importer, string oldData,
488488
return true;
489489
}
490490

491-
private string ReadUpdatedMetaFile(string oldData)
491+
private string ReadUpdatedMetaFile(string oldData, string targetPath, AssetImporter importer)
492492
{
493-
string[] lines = System.IO.File.ReadAllLines(AssetDatabase.GetAssetPath(_target) + ".meta");
493+
string[] lines = System.IO.File.ReadAllLines(targetPath + ".meta");
494494
foreach (string line in lines)
495495
{
496496
if (line.StartsWith(" userData: "))

0 commit comments

Comments
 (0)