Git Product home page Git Product logo

Comments (10)

810053735 avatar 810053735 commented on July 29, 2024

IEnumerator enumerator()
{
string path = "";
#if UNITY_IOS
#elif UNITY_ANDROID
path = @"http://172.31.100.84:80/Assembly-CSharp.patch.bytes";
#elif UNITY_EDITOR
path = @"http://localhost/Assembly-CSharp.patch.bytes";
#endif
var request = UnityWebRequest.Get(path);
yield return request.SendWebRequest();
if (request.isHttpError)
{
text.text = path + "isHttpError";
}
else if(request.isNetworkError) {
text.text = path + "isNetworkError";
}
else
{
text.text = "有下载到更新内容";
byte[] bytes = request.downloadHandler.data;
PatchManager.Load(new MemoryStream(bytes));
}
}
根据文档操作,在Unity实现了热修复,但是导出apk包有下载到更新文件但是不执行热更新的内容,查阅入门文档未找到答案,望大佬指点迷津!!

from injectfix.

810053735 avatar 810053735 commented on July 29, 2024

版本是2018.2.14f1
是否是导apk包需要做什么特殊处理
用静态初始方法调用IFixEditor.InjectAllAssemblys也没有见到效果

from injectfix.

chexiongsheng avatar chexiongsheng commented on July 29, 2024

看下加载补丁有没报错

from injectfix.

810053735 avatar 810053735 commented on July 29, 2024

看下加载补丁有没报错

Exception: can not load method [get_red] of UnityEngine.Color
E/Unity ( 3320): at IFix.Core.PatchManager.readMethod (System.IO.BinaryReader reader, System.Type[] externTypes) [0x00000] in :0
E/Unity ( 3320): at IFix.Core.PatchManager.Load (System.IO.Stream stream) [0x00000] in :0
E/Unity ( 3320): at LoadFixByte+c__Iterator0.MoveNext () [0x00000] in :0
E/Unity ( 3320): at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0
E/Unity ( 3320):
E/Unity ( 3320): (Filename: currently not available on il2cpp Line: -1)
E/Unity ( 3320):

这是报的错
结合我的代码
//更新前
text.text = "更新前为蓝色";
image.color = Color.blue;
//更新后
text.text = "更新为红色";
image.color = Color.red;

如果不对color进行改值的话 apk跑热修复是正常的

这是为什么 大佬方便的话可以解答一下吗 谢谢!!!

from injectfix.

chexiongsheng avatar chexiongsheng commented on July 29, 2024

unity剪裁了Color.red属性

from injectfix.

810053735 avatar 810053735 commented on July 29, 2024

unity剪裁了Color.red属性

有什么办法避免吗

from injectfix.

chexiongsheng avatar chexiongsheng commented on July 29, 2024

一般你新逻辑不会用到老逻辑没用过的api。

from injectfix.

chexiongsheng avatar chexiongsheng commented on July 29, 2024

真要避免就用link.xml配置一下。怎么配置看unity的文档

from injectfix.

810053735 avatar 810053735 commented on July 29, 2024

真要避免就用link.xml配置一下。怎么配置看unity的文档

收到 感谢!!!

from injectfix.

YuJiMing avatar YuJiMing commented on July 29, 2024

请问楼主这是在editor下的还是打包Windows的?

from injectfix.

Related Issues (20)

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.