-
Notifications
You must be signed in to change notification settings - Fork 21
RuntimeApi的问题请教 #5
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
Comments
好巧~ 今天 hybridCLR 更新了部分 API,我已同步更新。注意使用 HybridCLR Builder 编辑器工具重新安装一遍,重新生成桥接函数后打包,我已打包测试 windows64 没有问题。 |
重新生成桥接函数,重新编译hotfix.dll,重新打包。这些常见的错误可以在HybridCLR的使用文档中找到解决方法。 https://focus-creative-games.github.io/hybridclr/common_errors/ |
不使用编辑器资源模式,会使用streamingAssets下打的ab包,所以仍然可以进入游戏。这个是GameFramework的知识点。 关于逻辑热更新测试,可以看一下ProcedureCodeInit.cs,编辑器模式下加载的hotfix程序集,否则(运行时)加载hotfix.dll。 |
多谢反馈,刚刚整理并更新了Unity platform 和 GameFramework platform 之间平台表示符的转换 |
关于 Android 平台,dll文件不存在,应该是 可以检查一下 这个问题你自行测试吧😏,我是跟着 hybridclr_trial 改的 |
不好意思,我下午自己尝试的修改可能是有问题的。我跟踪了一下,发现BuildProcessor_2020_1_OR_NEWER.CopyStripDlls是在BuildProcessor_2020_1_OR_NEWER.OnPostprocessBuild调用的,但是安卓打包的时候实际上不会走到这个函数里面,而是直接走到BuildProcessor_2020_1_OR_NEWER.OnPostGenerateGradleAndroidProject里面了,这里面又走到AddBackHotFixAssembliesToJson函数里面了。windows打包我看到在HybridCLRData/AssembliesPostIl2CppStrip/下生成了StandaloneWindows64,理论上安卓打包这里需要生成Android文件夹的,但是实际上没有,是因为前面没有走到CopyStripDlls,请问这里你知道如何解决吗? |
不好意思,刚看到,我工作中没有用到 HybridCLR,也不发行 Android 平台,只是兴趣使然。 你可以试试官方 hybridclr_trial 打包 Android 会不会有问题,然后在 hybridclr 的新手群中讨论。 我也在群里面。期待你的解决方案。😄 |
下面是官方提供的代码,你可以试试 取消 public void OnPostGenerateGradleAndroidProject(string path)
{
Debug.Log("==== OnPostGenerateGradleAndroidProject");
// 由于 Android 平台在 OnPostprocessBuild 调用时已经生成完 apk 文件,因此需要提前调用
AddBackHotFixAssembliesToJson(null, path);
// 对于 2020, 已经在OnBeforeConvertRun中复制了,因此这儿不再复制
//#if UNITY_2021_1_OR_NEWER
// BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
// CopyStripDlls(target);
//#endif
}
public void OnPostprocessBuild(BuildReport report)
{
Debug.Log("==== OnPostprocessBuild");
#if !UNITY_ANDROID
AddBackHotFixAssembliesToJson(report, report.summary.outputPath);
#endif
// Unity 2021开始,不再清理这个Temp目录,因此在这个时机复制较为合适
#if UNITY_2021_1_OR_NEWER
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
CopyStripDlls(target);
#endif
} |
好滴,感谢感谢~~ |
你好,我遇到了一个问题
/Assets/Game/Scripts/Base/HybridCLR/RuntimeApi.cs中,21、24、27、30使用的是HuatuoApi_开头,然后我打包后,发现这个方法找不到。我看了下官方,手动将这个改成了RuntimeApi_开头。但是打包后依然报错误,这次是metadata type not match错误,请问我这种做法是对的吗?还是应该用什么办法解决此问题呀?
The text was updated successfully, but these errors were encountered: