From 5cfb875b73081d469a2e0db7c5668a987e29f7f4 Mon Sep 17 00:00:00 2001 From: liruishenga Date: Thu, 1 Nov 2018 21:41:37 +0800 Subject: [PATCH] Update Util.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetRelativePath()方法在编辑器模式下从StreamingAssets文件夹加载资源,其他情况都从DataPath加载即可 --- Assets/LuaFramework/Scripts/Utility/Util.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Assets/LuaFramework/Scripts/Utility/Util.cs b/Assets/LuaFramework/Scripts/Utility/Util.cs index 9424d971e..536972e96 100644 --- a/Assets/LuaFramework/Scripts/Utility/Util.cs +++ b/Assets/LuaFramework/Scripts/Utility/Util.cs @@ -208,10 +208,9 @@ public static string DataPath { public static string GetRelativePath() { if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; - else if (Application.isMobilePlatform || Application.isConsolePlatform) + else return "file:///" + DataPath; - else // For standalone player. - return "file://" + Application.streamingAssetsPath + "/"; + } /// @@ -330,4 +329,4 @@ public static bool CheckEnvironment() { return true; } } -} \ No newline at end of file +}