Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Owl-Man/FPS-Controller-for-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

FPS (Frame Per Second) Controller for Unity

By moving the FPS controller.cs script to the folder with your other scripts, you can limit the frame rate using the inspector in the Unity (changing the FPS integer variable) or by calling the SetFPS method. Also, through the inspector (changing the isVSyncActive bool variable) or by calling the DisableVSync/EnableVSync method, you can turn off and turn on VSync (Vertical Sync). All these methods are located in the FPS Controller class, which can be accessed using a singleton.

Example:

using UnityEngine;
public class Test : MonoBehaviour
{
 private FPSController FPSCntrl;
 
 private void Start() 
 {
 FPSCntrl = FPSController.instance;
 
 FPSCntrl.DisableVSync();
 FPSCntrl.SetFPS(60);
 }
}

FPS Controller script must be located in the scene and only once, to use its functions

About

FPS (Frames Per Second) Controller for Unity

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /