Created
November 10, 2020 02:43
-
-
Save baba-s/933a1900d0650e222db4ce4cca2675ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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