Unity3d Tutorial: Application Class Part5 - targetFrameRate

Unity3D 2012. 6. 13. 14:44
반응형

http://file:///Applications/Unity/Documentation/ScriptReference/Application-targetFrameRate.html

static var targetFrameRate : int

Description

Instructs game to try to render at a specified frame rate.

Setting targetFrameRate to -1 (the default) makes standalone games render as fast as they can, and web player games to render at 50-60 frames/second depending on the platform.

Note that setting targetFrameRate does not guarantee that frame rate. There can be fluctuations due to platform specifics, or the game might not achieve the frame rate because the computer is too slow.

If vsync is set in quality setting, the target framerate is ignored, and the vblank interval is used instead. The vBlankCount property on qualitysettings can be used to limit the framerate to half of the screens refresh rate (60 fps screen can be limited to 30 fps by setting vBlankCount to 2)

targetFrameRate is ignored in the editor.

C#
using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
Application.targetFrameRate = 300;
}
}

기본값 - 1 


유니티 에디터 문제인지 몰라도 한번 값을 바꾸면 이전값을 계속 가져오는듯 하다 이때는 에디터를 껐다 키면  정상적으로 기본값 -1을 확인할수 있다.




반응형
: