Jsbinding+bridge.net: The relationship between frame and logic

Source: Internet
Author: User

In the Jsb+bridge project you can maintain both CS version and JS version of the game.

Framework code: referred to as the framework, the code that does not make hot

Logic code: referred to as logic, the code that can be used for hot

In the CS project, the code is clearly divided into frameworks and logic. The framework code is placed in the assets/scripts/gameframework, and the logic code is placed in Assets/scripts/gamelogic. While the game is running, the framework code runs C #, and the logic code runs in C #.

In the JS project, the framework code is also under the Assets/scripts/gameframework, this directory is from the CS project mapped, modify any side of the content, the other side will automatically change. The logic code is placed in the assets/streamingassets/javascript/gen2.javascript. Gen2 is the JS code generated by the logic code compilation under CS engineering. During the game running, the framework code runs C #, and the logic code runs JS.

In the Bridgeproj project, assets/scripts/gamelogic the entire directory under CS project. His goal is to compile these logic code to generate JS code for the JS project to use. There is a problem here, logic code can rely on the framework code, if you just map the logic code to the Bridgeproj project, it is impossible to compile. The problem was solved by Csw.cs. For example

Back to: jsbinding+bridge.net:unity Game hot Update scheme

Jsbinding+bridge.net: The relationship between frame and logic

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.