|
|
|
|
|
|
using Unity.UIWidgets.editor; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.Rendering; |
|
|
|
|
|
|
|
namespace Unity.UIWidgets.ui { |
|
|
|
public delegate void VoidCallback(); |
|
|
|
|
|
|
|
|
|
|
public const int defaultMaxTargetFrameRate = 60; |
|
|
|
public const int defaultMinTargetFrameRate = 25; |
|
|
|
public const int defaultMaxRenderFrameInterval = 100; |
|
|
|
public const int defaultMinRenderFrameInterval = 1; |
|
|
|
|
|
|
|
static Action _onFrameRateSpeedUp = defaultFrameRateSpeedUp; |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static void defaultFrameRateSpeedUp() { |
|
|
|
#if UNITY_2019_3_OR_NEWER
|
|
|
|
OnDemandRendering.renderFrameInterval = defaultMinRenderFrameInterval; |
|
|
|
#else
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
static Action _onFrameRateCoolDown = defaultFrameRateCoolDown; |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static void defaultFrameRateCoolDown() { |
|
|
|
#if UNITY_2019_3_OR_NEWER
|
|
|
|
OnDemandRendering.renderFrameInterval = defaultMaxRenderFrameInterval; |
|
|
|
#else
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
} |