1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AYellowpaper.SerializedCollections;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -9,11 +10,19 @@ namespace BITKit
|
||||
public class SetTargetFrameRate : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private SerializedDictionary<string, int> frameRateDictionary;
|
||||
[SerializeField] private int startFrameRate;
|
||||
[SerializeField] private SerializedDictionary<RuntimePlatform, bool> maxFrameRate;
|
||||
private int currentFrameRate;
|
||||
private void Start()
|
||||
{
|
||||
currentFrameRate = Application.targetFrameRate;
|
||||
if(maxFrameRate.TryGetValue(Application.platform,out var max))
|
||||
{
|
||||
if (max)
|
||||
{
|
||||
var maxRate = Screen.resolutions.Max(x => x.refreshRateRatio.value);
|
||||
Application.targetFrameRate = currentFrameRate = (int)maxRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void SetFrameRate(string key)
|
||||
{
|
||||
|
Reference in New Issue
Block a user