@@ -163,16 +163,15 @@ public void EndAssetBundle()
163163 m_CurrentAssetBundleId = - 1 ;
164164 }
165165
166- public void WriteSerializedFile ( string filename , string folder )
166+ public void WriteSerializedFile ( string relativePath , string fullPath , string containingFolder )
167167 {
168- var fullPath = Path . Join ( folder , filename ) ;
169168 using var sf = UnityFileSystem . OpenSerializedFile ( fullPath ) ;
170169 using var reader = new UnityFileReader ( fullPath , 64 * 1024 * 1024 ) ;
171- using var pptrReader = new PPtrAndCrcProcessor ( sf , reader , Path . GetDirectoryName ( fullPath ) , AddReference ) ;
172- int serializedFileId = m_SerializedFileIdProvider . GetId ( filename . ToLower ( ) ) ;
170+ using var pptrReader = new PPtrAndCrcProcessor ( sf , reader , containingFolder , AddReference ) ;
171+ int serializedFileId = m_SerializedFileIdProvider . GetId ( Path . GetFileName ( fullPath ) . ToLower ( ) ) ;
173172 int sceneId = - 1 ;
174173
175- var match = m_RegexSceneFile . Match ( filename ) ;
174+ var match = m_RegexSceneFile . Match ( relativePath ) ;
176175
177176 if ( match . Success )
178177 {
@@ -185,7 +184,7 @@ public void WriteSerializedFile(string filename, string folder)
185184
186185 // There are 2 SerializedFiles per Scene, one ends with .sharedAssets. This is a
187186 // dirty trick to avoid inserting the scene object a second time.
188- if ( filename . EndsWith ( ".sharedAssets" ) )
187+ if ( relativePath . EndsWith ( ".sharedAssets" ) )
189188 {
190189 m_AddObjectCommand . Parameters [ "@id" ] . Value = sceneId ;
191190 m_AddObjectCommand . Parameters [ "@object_id" ] . Value = 0 ;
@@ -218,7 +217,7 @@ public void WriteSerializedFile(string filename, string folder)
218217 {
219218 m_AddSerializedFileCommand . Parameters [ "@id" ] . Value = serializedFileId ;
220219 m_AddSerializedFileCommand . Parameters [ "@asset_bundle" ] . Value = m_CurrentAssetBundleId == - 1 ? null : m_CurrentAssetBundleId ;
221- m_AddSerializedFileCommand . Parameters [ "@name" ] . Value = filename ;
220+ m_AddSerializedFileCommand . Parameters [ "@name" ] . Value = relativePath ;
222221 m_AddSerializedFileCommand . ExecuteNonQuery ( ) ;
223222
224223 int localId = 0 ;
0 commit comments