Merge branch 'bugfix/setting' into feature/scroll
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab3222005e06e4c4aad63f7fd097f61c
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Localization.Settings;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
@@ -40,7 +40,7 @@ namespace AibisDream
|
||||
switch (propName)
|
||||
{
|
||||
case "Volume":
|
||||
AudioManager.Instance.SetVolume(float.Parse(value));
|
||||
AudioManager.Instance.SetVolume(float.Parse(value, CultureInfo.InvariantCulture));
|
||||
break;
|
||||
case "TextSpeed":
|
||||
// TODO 调整文字速度
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using TMPro;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -34,9 +36,15 @@ namespace AibisDream
|
||||
|
||||
public override void SetValue(string value)
|
||||
{
|
||||
var floatValue = float.Parse(value);
|
||||
_slider.value = floatValue;
|
||||
_sliderText.text = Mathf.RoundToInt(floatValue * 100).ToString();
|
||||
if (float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var floatValue))
|
||||
{
|
||||
_slider.value = floatValue;
|
||||
_sliderText.text = Mathf.RoundToInt(floatValue * 100).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"SliderItem: 解析数值{value}失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user