且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

帮助做循环冻结我的游戏!

更新时间:2023-11-20 14:38:04

如果您的循环位于主UI线程中并且无法快速退出,您将看到此行为.

You will see this behavior if your loop is in the main UI thread and it does not exit quickly.

避免设计代码,以免它陷入故意的延迟循环,从而浪费CPU时间和电池.使用计时器函数或辅助线程进行延迟,等待资源等.

Avoid designing your code so it spins in an intentional delay loop, which consumes CPU time as well as the battery. Use timer functions or secondary threads for delays, waiting on resources, etc.

如果您的代码示例无济于事,请发布.

Post your code sample if this does not help get you going.

希望这会有所帮助,
标记

Hope this helps,
Mark