Unity Hot Update C # Real-combat experience Sharing (ii)-Dynamic Protobuff protocol, no more worrying about changing packets for a change of protocol ~~!

Source: Internet
Author: User

First of all, if any of the small partners feel unfamiliar, you can read this blog in front of the two blog, which tells the tall Jsb,unity hot update program, with the powerful universe first editor vs to develop Unity Thermal update script, update C # is not a dream

This demo project I have the long ball, the address here Http://pan.baidu.com/s/1qWQlXUW; after downloading (put on D plate on D plate on D disk!!!!) The Unity project inside opens and runs the main scene. will appear, the only meaning of this blog is the demo, the actual combat is not to tell you nonsense, do not talk about theory, directly to the version can be run


Why Hot update protobuff?

Cause: Can be installed in front of the server to say, you change the network protocol without changing the game bag ~~! You are ugly, you have to change an agreement to stop the service .....

What do you do?

How to do, this problem, I still strongly suggest to Baidu cloud disk download Demo project, point Open on the direct operation, I will strictly follow the demo here

Step 1: Establish a thermal update project, how to create a small partner, you can see the previous article, created well after. Then put the script I wrote

Step 2: Execute the script in the Unity project to write the experiment

The above code means to execute

This function, is not very simple??

, the core of this set of things used Https://github.com/dcodeIO/ProtoBuf.js, and then introduced with includes JS.

Then wrap it in C # with PROTOBUFFERWRAP CS for use in C # upper layer

Precautions

1,js inside the number and C # inside the long is not equal, which is caused by the language, not the protobuff problem. Protobuf.js itself has done the processing, the definition of JS long in long_min inside

2,decode out of the object after the cast, there is no function, in the entire JSB system only new objects will have function

Finally welcome to JSB QQ Group: 189738580, we wait for you

Unity Hot Update C # Real-combat experience Sharing (ii)-Dynamic Protobuff protocol, no more worrying about changing packets for a change of protocol ~~!

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.