Просмотр исходного кода

Update LogRedirection.cs (#504)

只有windows平台目录路径是\
sunset 2 лет назад
Родитель
Сommit
383abfba9e
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      Unity/Assets/Scripts/Editor/LogRedirection/LogRedirection.cs

+ 5 - 3
Unity/Assets/Scripts/Editor/LogRedirection/LogRedirection.cs

@@ -39,9 +39,11 @@ namespace ET
                         // 行号
                         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;
                     }
 
@@ -88,4 +90,4 @@ namespace ET
             return null;
         }
     }
-}
+}