Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created November 10, 2020 02:43
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/933a1900d0650e222db4ce4cca2675ff to your computer and use it in GitHub Desktop.
Save baba-s/933a1900d0650e222db4ce4cca2675ff to your computer and use it in GitHub Desktop.
using System;
using UnityEngine.Rendering;
namespace Kogane
{
public sealed class RenderFrameIntervalScope : IDisposable
{
private readonly int m_oldRenderFrameInterval;
public RenderFrameIntervalScope( int renderFrameInterval )
{
m_oldRenderFrameInterval = OnDemandRendering.renderFrameInterval;
OnDemandRendering.renderFrameInterval = renderFrameInterval;
}
public void Dispose()
{
OnDemandRendering.renderFrameInterval = m_oldRenderFrameInterval;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment