Skip to content

Commit 67a7447

Browse files
committed
make sure to write out "%YAML" to the new file
1 parent a138930 commit 67a7447

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Assets/FbxExporters/Editor/FbxExporterRepairMissingScripts.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ private static bool ReplaceGUIDInFile (string path)
7171
var sr = new StreamReader (path);
7272

7373
// verify that this is a text file
74+
var firstLine = "";
7475
if(sr.Peek() > -1){
75-
var firstLine = sr.ReadLine();
76+
firstLine = sr.ReadLine();
7677
if(!firstLine.StartsWith("%YAML")){
7778
sr.Close ();
7879
return false;
@@ -81,6 +82,10 @@ private static bool ReplaceGUIDInFile (string path)
8182

8283
var sw = new StreamWriter (path + ".remap", false);
8384

85+
if(!string.IsNullOrEmpty(firstLine)){
86+
sw.WriteLine(firstLine);
87+
}
88+
8489
while (sr.Peek () > -1) {
8590
var line = sr.ReadLine ();
8691

0 commit comments

Comments
 (0)