Skip to content
New issue

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

版本的两个错误的地方 #52

Open
KervenGame opened this issue Aug 9, 2018 · 0 comments
Open

版本的两个错误的地方 #52

KervenGame opened this issue Aug 9, 2018 · 0 comments

Comments

@KervenGame
Copy link

这个版本应该有两个错误的地方:
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,如有误请多见谅。

@ghost
Copy link

ghost commented Nov 29, 2018

你好,请问你在用这个框架更代码的时候有遇到报错吗?我遇到了这个问题:
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant