This commit is contained in:
CortexCore
2023-08-11 23:57:37 +08:00
parent 936a94c84b
commit 75889ec34f
149 changed files with 6524 additions and 1043 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections;
using System.Collections.Generic;
using AYellowpaper.SerializedCollections;
using UnityEngine;
namespace BITKit
{
public class SetTargetFrameRate : MonoBehaviour
{
[SerializeField] private SerializedDictionary<string, int> frameRateDictionary;
[SerializeField] private int startFrameRate;
private int currentFrameRate;
private void Start()
{
currentFrameRate = Application.targetFrameRate;
}
public void SetFrameRate(string key)
{
if (frameRateDictionary.TryGetValue(key, out var frameRate))
{
SetFrameRate(frameRate);
}else if (int.TryParse(key, out frameRate))
{
SetFrameRate(frameRate);
}
}
public void SetFrameRate(int frameRate)
{
Application.targetFrameRate =currentFrameRate = frameRate;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: abf7a0c09f983f0409351183f34dff83
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: