mirror of
https://github.com/BobbyRafael31/Unity-MazeRunner-Pathfinding-Visualizer.git
synced 2025-08-12 08:42:21 +00:00
18 lines
437 B
C#
18 lines
437 B
C#
using UnityEngine;
|
|
|
|
public class FrameLimiter : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// Melimit frame rate game ke 60 FPS
|
|
/// Limit dilakukan agar kalkulasi CPU yang digunakan sesuai dengan target FPS
|
|
/// </summary>
|
|
|
|
[SerializeField] private int frameRate = 60;
|
|
private int vSyncValue = 0;
|
|
void Start()
|
|
{
|
|
QualitySettings.vSyncCount = vSyncValue;
|
|
Application.targetFrameRate = frameRate;
|
|
}
|
|
}
|