简体   繁体   中英

Unity iOS performance issues (low frame rate)

Currently, I have a relatively simple 2D game which should not be too taxing on a cpu. It runs fine on my computer however when I build it to my iPhone or iPad the game starts to be quite jittery and has a poor frame rate. Does anyone have any suggestions on how I could improve the performance (I already use object pooling et cetera I think it has something to do with my draw calls / graphics) EDIT: turns out the renderer is using most of my cpu

If the issue is as you say too many draw calls then one simply way to reduce those is to pack your sprites using the Sprite Packer . This places all your sprites tightly which reduces the amount of draw calls, if they don't all fit nicely or there's too many of them then they will be split into subpages. If you'd like to see how to use the Unity texture packer in simple steps I would direct you to this blog post that talks about it in more depth. Here's a simple step by step guide that I based off of the blog post linked.

Step 1 Select all those sprites that you want to pack in together

Step 2 Give a Packing Tag as shown in the picture below:

在此处输入图片说明

Step 3 Open Sprite Packer window and perform packing

在此处输入图片说明

Step 4 Click the Pack button as seen above

There are also third party tools like Texture Packer that can do this, and they have more complex algorithms which gives them the edge over Unity's built in verison.

It's also possible there are issues with your games performance not relating directly to draw calls, I would recommend taking a look at the official Unity guide for mobile optimisation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM