2022-10-03 02:04:54 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using TMPro;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
public class TouchSettingManager : MonoBehaviour
|
|
|
|
{
|
|
|
|
void Start()
|
|
|
|
{
|
2022-11-05 01:32:17 +01:00
|
|
|
var sampleWidget = ConfigManager.GetConfigPanelWidget("TouchSampleRate");
|
|
|
|
|
|
|
|
var sampleDropdown = sampleWidget.GetComponent<TMP_Dropdown>();
|
|
|
|
|
|
|
|
sampleDropdown.onValueChanged.AddListener((int value) => {
|
|
|
|
string fpsString = Enum.GetName(typeof(CEnum.FPS), value);
|
|
|
|
Time.fixedDeltaTime = 1 / int.Parse(fpsString.Remove(0, 3));
|
|
|
|
});
|
|
|
|
|
|
|
|
sampleDropdown.onValueChanged?.Invoke(sampleDropdown.value);
|
2022-10-03 02:04:54 +02:00
|
|
|
}
|
|
|
|
}
|