This commit is contained in:
Lee 2024-01-03 02:03:19 +00:00
parent 529222e17d
commit 6c122db1b4
2 changed files with 3 additions and 4 deletions

@ -9,6 +9,7 @@ namespace frame_limiter
{
/**
* The frame limit to apply when the player is in the pause menu or loading screen.
* todo: make this configurable?
*/
private const int FrameLimit = 30;
@ -16,12 +17,11 @@ namespace frame_limiter
private static void AddMeToScene()
{
new GameObject("__FrameLimiter__").AddComponent<FrameLimiter>();
}
private void Update()
{
PlayerInventory inventory = LocalPlayer.Inventory;
var inventory = LocalPlayer.Inventory;
if (inventory == null)
{
return;
@ -34,7 +34,6 @@ namespace frame_limiter
Application.targetFrameRate = FrameLimit;
break;
}
case PlayerInventory.PlayerViews.Loading:
{
Application.targetFrameRate = FrameLimit;
@ -44,7 +43,7 @@ namespace frame_limiter
{
Application.targetFrameRate = PlayerPreferences.MaxFrameRate;
break;
}
}
}
}
}

Binary file not shown.