2022-08-18 23:17:30 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
public class TouchSettingManager : MonoBehaviour
|
|
|
|
{
|
|
|
|
TMP_Dropdown Dropdown;
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
Dropdown = GetComponent<TMP_Dropdown>();
|
|
|
|
GetTouchFPS();
|
|
|
|
}
|
|
|
|
void GetTouchFPS()
|
|
|
|
{
|
|
|
|
if (JsonConfig.HasKey("TouchFPS"))
|
|
|
|
Dropdown.value = JsonConfig.GetInt("TouchFPS");
|
|
|
|
SetTouchFPS();
|
|
|
|
}
|
|
|
|
public void SetTouchFPS()
|
|
|
|
{
|
|
|
|
switch (Dropdown.value)
|
|
|
|
{
|
|
|
|
case 0:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 30f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 60f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 90f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 120f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 4:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 140f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 5:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 160f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 6:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 180f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
case 7:
|
2022-08-19 00:08:42 +02:00
|
|
|
Time.fixedDeltaTime = 1 / 200f;
|
2022-08-18 23:17:30 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
JsonConfig.SetInt("TouchFPS", Dropdown.value);
|
|
|
|
}
|
|
|
|
}
|