Giter Club home page Giter Club logo

Comments (11)

GREAT1217 avatar GREAT1217 commented on September 23, 2024

好巧~ 今天 hybridCLR 更新了部分 API,我已同步更新。注意使用 HybridCLR Builder 编辑器工具重新安装一遍,重新生成桥接函数后打包,我已打包测试 windows64 没有问题。

from starforce_hybridclr.

huahuacn avatar huahuacn commented on September 23, 2024

感谢感谢,我刚刚试用了一下,我不知道是不是我这边的问题。我遇到了两个问题:

  1. 当我不使用编辑器资源模式时,我依然可以进游戏,它仍然读取了编辑器下面的资源,这样没办法在编辑器模式下测试热更了,请问现在HybridCLR就是这样的吗?=。=
  2. 当我忽略第一步,直接打包后运行出现以下错误
    image
    希望得到您的指点,感谢感谢。
    我的平台是Unity2021.3.1f1,打的包是windowsx64。

from starforce_hybridclr.

GREAT1217 avatar GREAT1217 commented on September 23, 2024

重新生成桥接函数,重新编译hotfix.dll,重新打包。这些常见的错误可以在HybridCLR的使用文档中找到解决方法。

https://focus-creative-games.github.io/hybridclr/common_errors/

from starforce_hybridclr.

GREAT1217 avatar GREAT1217 commented on September 23, 2024

不使用编辑器资源模式,会使用streamingAssets下打的ab包,所以仍然可以进入游戏。这个是GameFramework的知识点。

关于逻辑热更新测试,可以看一下ProcedureCodeInit.cs,编辑器模式下加载的hotfix程序集,否则(运行时)加载hotfix.dll。

from starforce_hybridclr.

huahuacn avatar huahuacn commented on September 23, 2024

感谢感谢,我现在windows已经测试通过了,但是安卓还有些问题,win平台有1个问题:

  1. 虽然我选择的是windowsx64,实际上还是在请求WindowsVersion.txt而不是Windows64Version.txt,我看了下ProcedureVersionCheck的 GetPlatformPath会只返回windows,没有windows64。
    然后就是安卓平台了,切换到安卓平台会报错,我看了下,报错在BuildProcessor_2020_1_OR_NEWER.cs中,需要在顶部加入:#if UNITY_ANDROID using UnityEditor.Android; #endif
    但是在选择安卓平台并编译dll时,又报错了,如下图:
    image
    我构建过了apk包,仍然没有用~

from starforce_hybridclr.

GREAT1217 avatar GREAT1217 commented on September 23, 2024

多谢反馈,刚刚整理并更新了Unity platform 和 GameFramework platform 之间平台表示符的转换

from starforce_hybridclr.

GREAT1217 avatar GREAT1217 commented on September 23, 2024

关于 Android 平台,dll文件不存在,应该是 BuildProcessor_2020_1_OR_NEWER.CopyStripDlls() 没有找到源路径。

可以检查一下 BuildConfig.GetOriginBuildStripAssembliesDir() 返回的路径是否正确。(Unity不同版本的这个路径改得😓)

这个问题你自行测试吧😏,我是跟着 hybridclr_trial 改的

from starforce_hybridclr.

huahuacn avatar huahuacn commented on September 23, 2024

不好意思,我下午自己尝试的修改可能是有问题的。我跟踪了一下,发现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,请问这里你知道如何解决吗?

from starforce_hybridclr.

GREAT1217 avatar GREAT1217 commented on September 23, 2024

不好意思,刚看到,我工作中没有用到 HybridCLR,也不发行 Android 平台,只是兴趣使然。

你可以试试官方 hybridclr_trial 打包 Android 会不会有问题,然后在 hybridclr 的新手群中讨论。

我也在群里面。期待你的解决方案。😄

from starforce_hybridclr.

GREAT1217 avatar GREAT1217 commented on September 23, 2024

下面是官方提供的代码,你可以试试 取消 OnPostGenerateGradleAndroidProject() 中注释的部分。

        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
        }

from starforce_hybridclr.

huahuacn avatar huahuacn commented on September 23, 2024

好滴,感谢感谢~~

from starforce_hybridclr.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.