Skip to content

Commit

Permalink
Update LogRedirection.cs (#504)
Browse files Browse the repository at this point in the history
只有windows平台目录路径是\
  • Loading branch information
u-xp authored Oct 30, 2023
1 parent b7d2997 commit 383abfb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Unity/Assets/Scripts/Editor/LogRedirection/LogRedirection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ private static bool OnOpenAsset(int instanceID, int line)
// 行号
line = Convert.ToInt32(pathLine.Substring(splitIndex + 1));
var fullPath = UnityEngine.Application.dataPath.Substring(0, UnityEngine.Application.dataPath.LastIndexOf("Assets", StringComparison.Ordinal));
fullPath = $"{fullPath}{path}";
#if UNITY_STANDALONE_WIN
fullPath = fullPath.Replace('/', '\\');
#endif
// 跳转到目标代码的特定行
InternalEditorUtility.OpenFileAtLineExternal(fullPath.Replace('/', '\\'), line);
InternalEditorUtility.OpenFileAtLineExternal(fullPath, line);
break;
}

Expand Down Expand Up @@ -88,4 +90,4 @@ private static string GetStackTrace()
return null;
}
}
}
}

0 comments on commit 383abfb

Please sign in to comment.