We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这个版本应该有两个错误的地方: 1.资源热更新不成功,Util.cs中GetRelativePath方法原来是 public static string GetRelativePath() { if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; else if (Application.isMobilePlatform || Application.isConsolePlatform) return "file:///" + DataPath; else // For standalone player. return "file://" + Application.streamingAssetsPath + "/"; } 应该改为如下: public static string GetRelativePath() { if (AppConst.UpdateMode) { return "file:///" + DataPath; } if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; else if (Application.isMobilePlatform || Application.isConsolePlatform) return "file:///" + DataPath; else // For standalone player. return "file://" + Application.streamingAssetsPath + "/"; } 2.打开更新模式和不以ab方式读取时,路径出错 public const bool UpdateMode = false; //更新模式-默认关闭 public const bool LuaByteMode = false; //Lua字节码模式-默认关闭 public const bool LuaBundleMode = false; //Lua代码AssetBundle模式 //LuaBundleMode修改为false,这样代码文件便不会以AssetBundle模式读取,会直接生效,以方便调试。 LuaConst.cs中,lua逻辑代码目录改为如下: //public static string luaDir = Application.dataPath + "/Lua"; //lua逻辑代码目录 public static string luaDir = Application.dataPath + "/LuaFramework/Lua"; ===》》》初次提issues,如有误请多见谅。
public static string GetRelativePath() { if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; else if (Application.isMobilePlatform || Application.isConsolePlatform) return "file:///" + DataPath; else // For standalone player. return "file://" + Application.streamingAssetsPath + "/"; }
public static string GetRelativePath() { if (AppConst.UpdateMode) { return "file:///" + DataPath; } if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; else if (Application.isMobilePlatform || Application.isConsolePlatform) return "file:///" + DataPath; else // For standalone player. return "file://" + Application.streamingAssetsPath + "/"; }
The text was updated successfully, but these errors were encountered:
你好,请问你在用这个框架更代码的时候有遇到报错吗?我遇到了这个问题: Failed to decompress data for the AssetBundle 'Memory'. UnityEngine.AssetBundle:LoadFromMemory(Byte[]) LuaFramework.LuaLoader:AddBundle(String) (at Assets/LuaFramework/Scripts/Common/LuaLoader.cs:35) LuaFramework.LuaManager:InitLuaBundle() (at Assets/LuaFramework/Scripts/Manager/LuaManager.cs:87) LuaFramework.LuaManager:InitStart() (at Assets/LuaFramework/Scripts/Manager/LuaManager.cs:25) LuaFramework.GameManager:OnInitialize() (at Assets/LuaFramework/Scripts/Manager/GameManager.cs:234)
Failed to decompress data for the AssetBundle 'Memory'. UnityEngine.AssetBundle:LoadFromMemory(Byte[]) LuaFramework.LuaLoader:AddBundle(String) (at Assets/LuaFramework/Scripts/Common/LuaLoader.cs:35) LuaFramework.LuaManager:InitLuaBundle() (at Assets/LuaFramework/Scripts/Manager/LuaManager.cs:87) LuaFramework.LuaManager:InitStart() (at Assets/LuaFramework/Scripts/Manager/LuaManager.cs:25) LuaFramework.GameManager:OnInitialize() (at Assets/LuaFramework/Scripts/Manager/GameManager.cs:234)
Sorry, something went wrong.
No branches or pull requests
这个版本应该有两个错误的地方:
1.资源热更新不成功,Util.cs中GetRelativePath方法原来是
public static string GetRelativePath() { if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; else if (Application.isMobilePlatform || Application.isConsolePlatform) return "file:///" + DataPath; else // For standalone player. return "file://" + Application.streamingAssetsPath + "/"; }
应该改为如下:
public static string GetRelativePath() { if (AppConst.UpdateMode) { return "file:///" + DataPath; } if (Application.isEditor) return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; else if (Application.isMobilePlatform || Application.isConsolePlatform) return "file:///" + DataPath; else // For standalone player. return "file://" + Application.streamingAssetsPath + "/"; }
2.打开更新模式和不以ab方式读取时,路径出错
public const bool UpdateMode = false; //更新模式-默认关闭
public const bool LuaByteMode = false; //Lua字节码模式-默认关闭
public const bool LuaBundleMode = false; //Lua代码AssetBundle模式
//LuaBundleMode修改为false,这样代码文件便不会以AssetBundle模式读取,会直接生效,以方便调试。
LuaConst.cs中,lua逻辑代码目录改为如下:
//public static string luaDir = Application.dataPath + "/Lua"; //lua逻辑代码目录
public static string luaDir = Application.dataPath + "/LuaFramework/Lua";
===》》》初次提issues,如有误请多见谅。
The text was updated successfully, but these errors were encountered: