1
0
mirror of synced 2024-12-05 02:57:57 +01:00
WACVR/Assets/Script/Configuration/TouchSettingManager.cs
2022-11-05 01:32:17 +01:00

23 lines
646 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using System;
public class TouchSettingManager : MonoBehaviour
{
void Start()
{
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);
}
}