Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created November 10, 2020 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baba-s/a9beb89569bef86e689207917cfd530f to your computer and use it in GitHub Desktop.
Save baba-s/a9beb89569bef86e689207917cfd530f to your computer and use it in GitHub Desktop.
using System;
using UnityEngine;
namespace Kogane
{
public sealed class TargetFrameRateScope : IDisposable
{
private readonly int m_oldTargetFrameRate;
public TargetFrameRateScope( int targetFrameRate )
{
m_oldTargetFrameRate = Application.targetFrameRate;
Application.targetFrameRate = targetFrameRate;
}
public void Dispose()
{
Application.targetFrameRate = m_oldTargetFrameRate;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment