vsync count Don't Sync
Application.targetFrameRate 设置FPS上限
Every Second VBlank 30
Every VBlank 60
Android是这样 Editor也是这样 空白IOS工程也是这样
xconde里面 preferredFramesPerSecond
ref:https://developer.apple.com/library/content/documentation/3DDrawing/Conceptual/MTLBestPracticesGuide/FrameRate.html
最终呢 是这样的 根据网上的信息 vsync的setting可以覆盖 Application.targetFrameRate的设置除非Don't Sync
这条在各个平台 包括ios的editor里面都是符合的
但是 IOS 手机里 只受这个 Application.targetFrameRate的控制 与vsync count 设置无关
他们 挺坑的
- (void)callbackFramerateChange:(int)targetFPS
{
int maxFPS = (int)[UIScreen mainScreen].maximumFramesPerSecond;
if (targetFPS <= 0)
targetFPS = UnityGetTargetFPS();
if (targetFPS > maxFPS)
targetFPS = maxFPS;
_enableRunLoopAcceptInput = (targetFPS == maxFPS && UnityDeviceCPUCount() > 1);
_displayLink.preferredFramesPerSecond = targetFPS;
}
{
int maxFPS = (int)[UIScreen mainScreen].maximumFramesPerSecond;
if (targetFPS <= 0)
targetFPS = UnityGetTargetFPS();
if (targetFPS > maxFPS)
targetFPS = maxFPS;
_enableRunLoopAcceptInput = (targetFPS == maxFPS && UnityDeviceCPUCount() > 1);
_displayLink.preferredFramesPerSecond = targetFPS;
}
Android don't vsync 时 targetFrameRate为30