Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Editor/RateRequestTrackerTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
using UnityEditor.IMGUI.Controls;
using UniRate.Debug;

#if UNITY_2023_1_OR_NEWER
using TreeView = UnityEditor.IMGUI.Controls.TreeView<int>;
using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem<int>;
using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState<int>;
#else
using TreeView = UnityEditor.IMGUI.Controls.TreeView;
using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem;
using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState;
#endif

namespace UniRate.Editor {

public class RateRequestTrackerTreeView : TreeView {
Expand Down
4 changes: 4 additions & 0 deletions Runtime/Controllers/RateManagerUpdateRateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ protected override void ApplyTargetValueToUnitySettings() {
// QualitySettings.vSyncCount value must be 0, 1, 2, 3, or 4.
// QualitySettings.vSyncCount is ignored on iOS.
vSyncCount = Mathf.Clamp(
#if UNITY_2022_2_OR_NEWER
Mathf.RoundToInt((float)UnityScreen.currentResolution.refreshRateRatio.value) / targetFrameRate,
#else
UnityScreen.currentResolution.refreshRate / targetFrameRate,
#endif
1,
4
);
Expand Down
4 changes: 4 additions & 0 deletions Runtime/RateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public static RateManager Instance {
}
#endif
if (!IsApplicationQuitting && _instance == null) {
#if UNITY_2023_1_OR_NEWER
_instance = FindAnyObjectByType<RateManager>();
#else
_instance = FindObjectOfType<RateManager>();
#endif
if (_instance == null) {
var go = new GameObject();
_instance = go.AddComponent<RateManager>();
Expand Down