Skip to content

Instantly share code, notes, and snippets.

@RimuruDev
Created August 11, 2025 15:33
Show Gist options
  • Select an option

  • Save RimuruDev/e2b35243441eac15b605fa1ab4c2abed to your computer and use it in GitHub Desktop.

Select an option

Save RimuruDev/e2b35243441eac15b605fa1ab4c2abed to your computer and use it in GitHub Desktop.
using UnityEngine;
public sealed class ApplyDisplayRefreshRate : ILoadUnit
{
public UniTask Load()
{
QualitySettings.vSyncCount = 0;
var hz = Mathf.RoundToInt(Screen.currentResolution.refreshRateRatio.value);
Application.targetFrameRate = Mathf.Clamp(hz, 30, 240);
return UniTask.CompletedTask;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment