Achieve efficient battle drift in Unity3d

Source: Internet
Author: User

All rights reserved, reprint must indicate the source!
like the fire shadow, like Java, like Unity3d, like game development can join mu ye cun q Group: 379076227



This week, some netizens mentioned the use of Ngui to fight blood, take the injury and other text performance is too poor. That's true, I've also found that UIPanel occupies a high CPU on the profile before (on the Android machine NGUI 3.8.2,1000 block).

So eventually in the fight floating the text this piece does not use Ngui, but creates the mesh itself to handle. The optimization on the phone before and after about 10 frames per second increased.


Look at the effect first.


You can see that Drawcall and Ngui are all 1.

This meshtext is the HUD text component I wrote myself.


The code is as follows:

----code is temporarily closed, sorry Friday will be public.


There should be no explanation for this code, mainly about triangular vertex calculations and UV computing. Find an article to create a mesh to read it should be able to understand.

Although the Ngui Atlas is used inside, rendering and updating are completely unrelated to Ngui.

If you want to change to an atlas without Ngui, you can. But at that time more lazy, already has the Atlas, directly take over to use slightly.

Do not want to use the Ngui Atlas can be modified by itself. This can be run out of Ngui.


The complete project (based on Unity3d 4.3.3 and NGUI3.8.2 test) will appear here after uploading.


Achieve efficient battle drift in Unity3d

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.