修改设置界面
This commit is contained in:
@@ -16,6 +16,7 @@ namespace NBF
|
||||
BtnPrev.onClick.Set(OnPrev);
|
||||
BtnNext.onClick.Set(OnNext);
|
||||
Slider.onChanged.Set(OnSliderChanged);
|
||||
ComboBox.onChanged.Set(OnComboBoxChanged);
|
||||
}
|
||||
|
||||
public void SetData(OptionBase option)
|
||||
@@ -24,18 +25,34 @@ namespace NBF
|
||||
|
||||
if (option is IMultiOption multiOption)
|
||||
{
|
||||
style.selectedIndex = 0;
|
||||
if (multiOption.IsDropdown)
|
||||
{
|
||||
style.selectedIndex = 2;
|
||||
if (multiOption.IsDropdown)
|
||||
{
|
||||
ComboBox.items = multiOption.GetOptionNames().ToArray();
|
||||
ComboBox.selectedIndex = multiOption.GetValue();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
style.selectedIndex = 1;
|
||||
}
|
||||
}
|
||||
else if (option is RangeOption range)
|
||||
{
|
||||
style.selectedIndex = 1;
|
||||
style.selectedIndex = 3; //进度类型
|
||||
Slider.min = range.MinValue;
|
||||
Slider.max = range.MaxValue;
|
||||
Slider.wholeNumbers = true;
|
||||
}
|
||||
else if (option is KeyBoardOption keyBoardOption)
|
||||
{
|
||||
style.selectedIndex = 2;
|
||||
style.selectedIndex = 4; //按键类型
|
||||
}
|
||||
else
|
||||
{
|
||||
style.selectedIndex = 0;
|
||||
}
|
||||
|
||||
TextName.SetLanguage(Option.Name);
|
||||
@@ -65,7 +82,8 @@ namespace NBF
|
||||
if (Option is ResolutionSetting resolutionSetting)
|
||||
{
|
||||
var res = Screen.resolutions;
|
||||
Debug.LogError($"next index={index} count = {multiOption.GetOptionNames().Count} res={res.Length}");
|
||||
Debug.LogError(
|
||||
$"next index={index} count = {multiOption.GetOptionNames().Count} res={res.Length}");
|
||||
}
|
||||
|
||||
multiOption.SetValue(index);
|
||||
@@ -137,6 +155,15 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
|
||||
private void OnComboBoxChanged()
|
||||
{
|
||||
Debug.Log(ComboBox.selectedIndex);
|
||||
if (Option is IMultiOption multiOption)
|
||||
{
|
||||
multiOption.SetValue(ComboBox.selectedIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateValueText()
|
||||
{
|
||||
Pages.visible = false;
|
||||
|
||||
Reference in New Issue
Block a user