After the MuMu emulator runs for a period of time, the Device.Present time-consuming suddenly increases

1) After the MuMu emulator runs for a period of time, the Device.Present time-consuming suddenly rises
2) ​How to obtain temperature information during the running process
3) Input System mouse replaces the main button bug
4) How to prohibit Unity from sending to https://config.uca .cloud.unity3d.com sends device information


This is the 347th UWA technical knowledge sharing push, which selects hot topics in the UWA community, covers UWA Q&A, community posts and other technical knowledge points, to help everyone master and learn more comprehensively.

Platform

Q: After the MuMu emulator runs for an unfixed period of time, the Device.Present time-consuming suddenly rises. There is a loaded semaphore waiting for a long time in the Profiler. I don’t understand the reason. I would like to ask if there is a friend who can help explain .

The following figure is a process recorded by Profiler:


Engine version used: Unity 2019.4.28f.

The MuMu simulator has tried multiple versions of 32-bit and 64-bit and can reproduce this problem, but the real machine and other simulators have not encountered it.

We compared another project with the same engine version, and found that the following settings seem to affect this problem. It is not very sure, because of two points: 1. The time when this problem occurred is uncertain;
2.
On a colleague’s simulator You only need to set BlitType to Always and you will not encounter the above problems, while another colleague's simulator needs to set BlitType to Always and disable Optimized Frame Pacing.

A1: I also encountered the same problem. It seems that only turning off Optimized Frame Pacing is effective.

Thanks to JackCheng@UWA Q&A community for providing answers

A2: It is recommended to try and set the frame limit forcibly after a period of time:

IEnumerator Start()
{
    yield return new WaitForSeconds(10);

    Application.targetFrameRate = 31;

    Application.targetFrameRate = 30;
}

Thanks to littlesome@UWA Q&A community for providing answers

A3: I also encountered exactly the same problem. I feel that it is easier to appear when the simulator is idle (usually within ten minutes), but it is not easy if it is always in operation (it takes about an hour).

Under normal circumstances, if the game is stuck, the emulator will also be very stuck. In this case, the emulator has almost no effect, and other things can be opened normally. It is suspected that the emulator does not support Google's Optimized Frame Pacing very well, and changing to a higher version of the Android SDK is also invalid.

Turning on these two options will indeed improve the experience on the mobile phone.

The solution I want to explore now is to turn off Optimized Frame Pacing at runtime when it is judged that the Andorid system version is relatively low.

Haven't found a way to turn it off at runtime yet.

Thanks to leviyuan@UWA Q&A community for providing answers


Performance

Q: How to get the temperature during operation? I need to make a function, if the temperature is high, the frame and image quality will be lowered.

A: The rules of temperature statistics are quite complicated, because the number of temperature values ​​obtained by different devices is very different (some can only get battery temperature, some can get more than 20 temperatures, including battery, each CPU, multiple GPU, various sensors, etc.), so although the acquisition mechanism of different tools is similar, the calculated temperature should be somewhat different.

Then the temperature value obtained by the tool does not correspond to the temperature in most cases (the temperature value is high, but the temperature in the hand is not high), so it is not recommended to use the obtained temperature value as an accurate basis for heating. It is better to use values ​​such as FPS that can be accurately counted.

This answer was provided by UWA


Script

Q: Description of the problem: Bind the right button of the mouse to an action named Cancel. At this time, the event can be received when the right button is clicked, and then the main button of the mouse is replaced with the right button in the settings. At this time, our expectation is that clicking the left button will receive the event. Event, right-clicking does not receive the event, but on most computers, the event Cancel is still received by right-clicking.

Temporary solution: The mouse button function is not implemented through the Input System, but is implemented with Input.GetMouseButtonDown.

Unity version: 2020.3
Input System version: 1.3.0
System: Windows10, Windows11

Has anyone encountered this problem, or has a solution?

A1: It may be that your keymap is not set properly. Under normal circumstances, there is a default key setting, which is your original one. Then there is another layer of key settings for modification on the outer layer. Operate the modifiable key settings during general operation.

Thanks to Manhua@UWA Q&A Community for providing answers

A2: The idea of ​​the Input System is to change the function implemented by the code into the configuration implementation, so the settings should not be modified during runtime. Another point is that the performance of the same configuration on different computers is inconsistent. If the upper layer function depends on an unstable The bottom layer, the upper layer cannot be corrected.

Thanks to the question owner Li Wei@UWA Q&A Community for providing an answer


Platform

Q: Unity transfers to the WeChat mini-game, and finds that it will send a request to https://config.uca.cloud.unity3d.com when it starts, which affects the start-up time.

Is there a way to switch off, version 2019, 2021.

A: Check if there is a keyword like Disable HW Statistics in the release settings.

Thanks to Li Wei@UWA Q&A Community for providing answers

The cover image comes from the Internet


That's all for today's sharing. Life has a limit but knowledge has no limit. In the long development cycle, the problems we encountered are just the tip of the iceberg. The UWA community is willing to accompany you to explore and share together. More developers are welcome to join the UWA community.

UWA official website: www.uwa4d.com
UWA community: community.uwa4d.com

 

Guess you like

Origin blog.csdn.net/UWA4D/article/details/132183926