1
0
mirror of synced 2024-12-12 14:31:04 +01:00
WACVR/Assets/Script/Configuration/TouchSettingManager.cs

23 lines
646 B
C#
Raw Normal View History

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
}
}