I'm using the Unity Hot Update Scenario JSB (recommended for small series)

Source: Internet
Author: User
Tags lua

Today Friday, there is nothing to do tomorrow, you can write some blog.

Talk about two topics today

One, the dilemma of Unity Hot update

Two, the Unity Hot update Scenario I used JSB

====================================== Hot Update Dilemma =============================================

(1) In fact, Unity hot update to the bottleneck is the iOS system itself, prohibit you jit. Plainly, in-memory code, the system itself does not let you execute.

Android system, desktop system, itself supports the dynamic direct replacement of DLLs, the hot update scheme is relatively more, I do not list all of them.

I think, the iOS can not run up the hot update program, are not clearance of the hot update program, (not you to hit me AH).

=========================== lua============================

Now the most Popular Unity update scheme in the country is LUA (Ulua http://www.ulua.org/and Slua http://www.slua.net/), why I only say these two, think other LUA solutions, such as

Unilua (Https://github.com/xebecnan/UniLua Yunfeng Great God's C # implementation), less efficient than the previous two (execution engine in C # to write, you think it will be faster than C write it?) Moreover, the front two bits are static binding, can be completely without reflection, efficiency is self-evident) The goal is gradually fade out; also moon http://www.moonsharp.org/is also C # LUA implementation, the efficiency problem is worrying (but the author is very love, I like it).

================================l#=============================

When it comes to hot updates, you still have to mention Lee's l#, really is the masterpiece of ideas, (l# 's first version, Li Http://www.cnblogs.com/crazylights also took 2 days to complete, the great God is the great God), l# directly built-in C # version of the DLL of virtual machines. But some problems are also reflected in the il2cpp of iOS, which has a variety of risks. And the efficiency itself is limited by the language of C # itself, there are bottlenecks. I frankly said l# no Ulua and Slua fast (not to beat me)

==================================jsb=======================

(2) Finally, I started to introduce my use of JSB, this is JSB author's blog http://www.cnblogs.com/answerwinner/p/4469021.html. Its skeleton is your offline C # code, through the Sharpkit (a C # to JS tool), into the JS script, these JS script will bind some of your unity's internal classes, and then put these scripts into the spidermokey inside execution, overall, you can simply write C # can To completely offline update logic. Let me tell you why I chose JSB.

One reason, I don't want to be proficient in the second language. We do the game client needs to know a lot of things, you engage in unity, familiar with C # can be, if you have to focus on learning Lua and JS above, you put two languages are used ripe time, why not to learn 3d graphics, rendering, shader, my energy is limited, I am not Superman. I don't want to be proficient in the second language (in fact, I myself Java oc Lua JS PHP General Simple code is not a problem, but also for some emerging languages such as rust go, etc. have a high interest), just said the industry has specialized

Cause two, efficiency issues. Frankly speaking, JSB does not have LUA fast, I think that Lua is born to do embedded script life, but spidermonkey efficiency is enough to support the client, (0.1ms than 0.2ms faster, yes, but the user does not feel), and JSB of the entire solution, is not There is reflection, completely static binding unity inner class, so say, efficiency issues you rest assured that the principle and cocos-js are the same.

================================================= Epilogue =======================================

My previous project was using LUA, which I wrote very poorly, and I felt that writing large projects C # was a bit better than Lua, with pure personal insight. I am using JSB, the development efficiency is very high, I a new colleague, C # learned for a month or two, write hot update code, no pressure. This is my hands-on practice, and you are welcome to understand JSB, using JSB

QQ Group: 189738580. We'll wait for you, Theo.

I'm using the Unity Hot Update Scenario JSB (recommended for small series)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.