Unity Framework (Code structure) summary

Source: Internet
Author: User

As a developer, dealing with the framework is unavoidable, such as C # has Ioc,java spring,hibernate,mybatis,structs2 and so on, but unity does not have a mature framework for us to use now, So we can only maximize the organization of our code, so that later maintenance

1. Notes, svn or git log

2. According to the script function write decision script mode, script naming must be easy to understand

such as the scripting of the Independence function (public), write a separate script and then hang it on the object

There is also a global controller that uses singleton patterns, such as Gamecontroller and Inputcontroller,uicontroller

Constant class GlobalManager.cs to control the game's global variables and global methods. Static class mode

3. Large scene to consider the efficiency, when necessary to have a scene to restore

4. Avoid using Gameobject.find and SendMessage, declare object references to show dependencies between scripts, and utilize delegate decoupling

5. Use Coroutine

Unity Framework (Code structure) summary

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.