Initial import of Rhyculator
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
728bb0c657
315 files changed
+96030
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
// 啟動時的全域設定
|
||||
public static class GameBoot
|
||||
{
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
static void Init()
|
||||
{
|
||||
// 幀率上限 = 螢幕支援的最高更新率(120Hz 手機就跑 120)
|
||||
// 注意:Android 上 targetFrameRate = -1 代表平台預設 30fps,不是無限制;
|
||||
// 超過螢幕更新率的幀也看不到,只會增加耗電與發熱
|
||||
QualitySettings.vSyncCount = 0;
|
||||
Application.targetFrameRate = Mathf.Max(60, MaxRefreshRate());
|
||||
}
|
||||
|
||||
static int MaxRefreshRate()
|
||||
{
|
||||
double max = Screen.currentResolution.refreshRateRatio.value;
|
||||
foreach (var r in Screen.resolutions)
|
||||
if (r.refreshRateRatio.value > max) max = r.refreshRateRatio.value;
|
||||
return Mathf.RoundToInt((float)max);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user