调整目录结构
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc7b116a771640d58d650ff79698f301
|
||||
timeCreated: 1748589438
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局各向异性纹理过滤模式
|
||||
/// </summary>
|
||||
[Sort(7)]
|
||||
public class AnisotropicModeSetting : MultiOption<AnisotropicFiltering>
|
||||
{
|
||||
public override string Name => "AnisotropicMode";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
|
||||
protected override int DefaultValue => (int)AnisotropicFiltering.Enable;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var enumValues = Enum.GetValues(typeof(AnisotropicFiltering));
|
||||
foreach (var value in enumValues)
|
||||
{
|
||||
AddOption(value.ToString(), (AnisotropicFiltering)value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// 获取当前URP Asset
|
||||
UniversalRenderPipelineAsset URPAsset =
|
||||
QualitySettings.GetRenderPipelineAssetAt(QualitySettings.GetQualityLevel()) as
|
||||
UniversalRenderPipelineAsset;
|
||||
if (URPAsset)
|
||||
{
|
||||
//全局各向异性纹理过滤模式
|
||||
QualitySettings.anisotropicFiltering = GetSelectedOption();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b96e677183324f5d8d01e786a828c0db
|
||||
timeCreated: 1748590207
|
||||
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(1)]
|
||||
public class FullScreenModeSetting : MultiOption<FullScreenMode>
|
||||
{
|
||||
public override string Name => "FullScreenMode";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
protected override int DefaultValue => (int)FullScreenMode.ExclusiveFullScreen;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
AddOption(nameof(FullScreenMode.ExclusiveFullScreen), FullScreenMode.ExclusiveFullScreen);
|
||||
AddOption(nameof(FullScreenMode.Windowed), FullScreenMode.Windowed);
|
||||
AddOption(nameof(FullScreenMode.FullScreenWindow), FullScreenMode.FullScreenWindow);
|
||||
AddOption(nameof(FullScreenMode.MaximizedWindow), FullScreenMode.MaximizedWindow);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// Screen.fullScreenMode = GetSelectedOption();
|
||||
// Debug.Log($"FullScreenMode: {Screen.fullScreenMode} value: {GetSelectedOption()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a6386dea2d44f3fb004905e688b97d5
|
||||
timeCreated: 1748588770
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public enum AnisotropicLevelEnum
|
||||
{
|
||||
Off = -1,
|
||||
x2 = 2,
|
||||
x4 = 4,
|
||||
x8 = 8,
|
||||
x16 = 16
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 全局各向异性过滤限制
|
||||
/// </summary>
|
||||
[Sort(8)]
|
||||
public class GlobalAnisotropicFilteringLimitsSetting : MultiOption<AnisotropicLevelEnum>
|
||||
{
|
||||
public override string Name => "GlobalAnisotropicFilteringLimits";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
protected override int DefaultValue => (int)AnisotropicLevelEnum.x4;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var enumValues = Enum.GetValues(typeof(AnisotropicLevelEnum));
|
||||
foreach (var value in enumValues)
|
||||
{
|
||||
AddOption(value.ToString(), (AnisotropicLevelEnum)value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// 获取当前URP Asset
|
||||
UniversalRenderPipelineAsset URPAsset =
|
||||
QualitySettings.GetRenderPipelineAssetAt(QualitySettings.GetQualityLevel()) as
|
||||
UniversalRenderPipelineAsset;
|
||||
if (URPAsset)
|
||||
{
|
||||
var current = QualitySettings.anisotropicFiltering;
|
||||
var level = GetSelectedOption();
|
||||
if (current == AnisotropicFiltering.Disable ||
|
||||
current == AnisotropicFiltering.Enable)
|
||||
{
|
||||
Texture.SetGlobalAnisotropicFilteringLimits(-1, -1);
|
||||
}
|
||||
else if (current == AnisotropicFiltering.ForceEnable)
|
||||
{
|
||||
Texture.SetGlobalAnisotropicFilteringLimits((int)level, (int)level);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6937878e8f61426687c62e26252e9258
|
||||
timeCreated: 1748590403
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public enum MsaaSampleEnum
|
||||
{
|
||||
Off = 1,
|
||||
x2 = 2,
|
||||
x4 = 4,
|
||||
x8 = 8
|
||||
}
|
||||
|
||||
[Sort(6)]
|
||||
public class MsaaSampleSetting : MultiOption<MsaaSampleEnum>
|
||||
{
|
||||
public override string Name => "MsaaSample";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
protected override int DefaultValue => (int)MsaaSampleEnum.Off;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var enumValues = Enum.GetValues(typeof(MsaaSampleEnum));
|
||||
foreach (var value in enumValues)
|
||||
{
|
||||
AddOption(value.ToString(), (MsaaSampleEnum)value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// 获取当前URP Asset
|
||||
UniversalRenderPipelineAsset URPAsset =
|
||||
QualitySettings.GetRenderPipelineAssetAt(QualitySettings.GetQualityLevel()) as
|
||||
UniversalRenderPipelineAsset;
|
||||
if (URPAsset)
|
||||
{
|
||||
//抗锯齿等级
|
||||
URPAsset.msaaSampleCount = (int)GetSelectedOption();
|
||||
URPAsset.supportsHDR = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae51922900c9429cb0de97b473a3429e
|
||||
timeCreated: 1748589774
|
||||
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
/// <summary>
|
||||
/// 画质设置
|
||||
/// </summary>
|
||||
[Sort(3)]
|
||||
public class QualityLevelSetting : MultiOption<int>
|
||||
{
|
||||
private int _defaultQualityLevel;
|
||||
public override string Name => "QualityLevel";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
protected override int DefaultValue => _defaultQualityLevel;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var names = QualitySettings.names;
|
||||
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
{
|
||||
AddOption(names[i], i);
|
||||
}
|
||||
|
||||
_defaultQualityLevel = QualitySettings.GetQualityLevel();
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
QualitySettings.SetQualityLevel(GetSelectedOption());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 470180f8a41b4856bf3318bc60f2abf1
|
||||
timeCreated: 1748588124
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(5)]
|
||||
public class RenderScaleSetting : RangeOption
|
||||
{
|
||||
public override string Name => "RenderScale";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
public override int MinValue => 1;
|
||||
public override int MaxValue => 20;
|
||||
|
||||
protected override int DefaultValue => 10;
|
||||
|
||||
public override int ShowRate => 10;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
SetValue(10);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// 获取当前URP Asset
|
||||
UniversalRenderPipelineAsset URPAsset =
|
||||
QualitySettings.GetRenderPipelineAssetAt(QualitySettings.GetQualityLevel()) as
|
||||
UniversalRenderPipelineAsset;
|
||||
if (URPAsset)
|
||||
{
|
||||
//渲染比例
|
||||
URPAsset.renderScale = (float)Math.Round(GetValue() / 10f, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e54edac5d4fe4dbda2da5bce433482dc
|
||||
timeCreated: 1748589449
|
||||
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
/// <summary>
|
||||
/// 分辨率设置
|
||||
/// </summary>
|
||||
[Sort(2)]
|
||||
public class ResolutionSetting : MultiOption<Resolution>
|
||||
{
|
||||
private int _defaultResolution;
|
||||
public override string Name => "Resolution";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
protected override int DefaultValue => _defaultResolution;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var supportedResolutions = Screen.resolutions
|
||||
.GroupBy(r => $"{r.width}x{r.height}") // 按宽高分组
|
||||
.Select(g => g.OrderByDescending(r => r.refreshRateRatio).First())
|
||||
.ToArray();
|
||||
foreach (var resolution in supportedResolutions)
|
||||
{
|
||||
if (resolution.width < 720 || resolution.height < 720) continue;
|
||||
AddOption($"{resolution.width}x{resolution.height}", resolution);
|
||||
Log.Info($"Resolution {resolution.width}x{resolution.height}");
|
||||
}
|
||||
|
||||
TryGetIndex(t =>
|
||||
t.width == Screen.currentResolution.width && t.height == Screen.currentResolution.height,
|
||||
out _defaultResolution);
|
||||
|
||||
if (_defaultResolution < 0)
|
||||
{
|
||||
_defaultResolution = 0;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
var resolution = GetSelectedOption();
|
||||
Log.Info($"Screen.fullScreenMode {Screen.fullScreenMode}");
|
||||
var mode = FullScreenMode.ExclusiveFullScreen;
|
||||
var screenMode = Root.GetSettingOption<FullScreenModeSetting>();
|
||||
if (screenMode != null)
|
||||
{
|
||||
mode = screenMode.GetSelectedOption();
|
||||
}
|
||||
|
||||
if (mode == FullScreenMode.ExclusiveFullScreen)
|
||||
{
|
||||
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
Screen.SetResolution(resolution.width, resolution.height, mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08fa420645764519a7a960565464a708
|
||||
timeCreated: 1748586208
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public enum TextureQualityEnum
|
||||
{
|
||||
FullRes = 0,
|
||||
HalfRes = 1,
|
||||
QuarterRes = 2,
|
||||
EighthRes = 3
|
||||
}
|
||||
|
||||
[Sort(9)]
|
||||
public class TextureQualitySetting : MultiOption<TextureQualityEnum>
|
||||
{
|
||||
public override string Name => "TextureQuality";
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
protected override int DefaultValue => (int)TextureQualityEnum.FullRes;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var enumValues = Enum.GetValues(typeof(TextureQualityEnum));
|
||||
foreach (var value in enumValues)
|
||||
{
|
||||
AddOption(value.ToString(), (TextureQualityEnum)value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// 获取当前URP Asset
|
||||
UniversalRenderPipelineAsset URPAsset =
|
||||
QualitySettings.GetRenderPipelineAssetAt(QualitySettings.GetQualityLevel()) as
|
||||
UniversalRenderPipelineAsset;
|
||||
if (URPAsset)
|
||||
{
|
||||
//纹理质量
|
||||
QualitySettings.globalTextureMipmapLimit = (int)GetSelectedOption();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7ca1e2468b24b6285be9176ae024864
|
||||
timeCreated: 1748590058
|
||||
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
/// <summary>
|
||||
/// 垂直同步
|
||||
/// </summary>
|
||||
[Sort(4)]
|
||||
public class VSyncSetting : ToggleOption
|
||||
{
|
||||
public override string Name => "VSync";
|
||||
|
||||
public override string Group => SettingsDef.Group.Graphic;
|
||||
public override string Tab => SettingsDef.Tab.Graphic;
|
||||
protected override int DefaultValue => 0;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
//垂直同步
|
||||
QualitySettings.vSyncCount = GetSelectedOption() ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00628a08aaac416796a4018119e77cc6
|
||||
timeCreated: 1748585191
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f72256d425749e3a05fd57c209d057d
|
||||
timeCreated: 1749539093
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputAddBobSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputAddBob";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.AddBob;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 673bfd453717403998342a57e58b9b3a
|
||||
timeCreated: 1749634714
|
||||
@@ -0,0 +1,19 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputChatSetting : KeyBoardOption
|
||||
{
|
||||
private int _defaultKey;
|
||||
public override string Name => "InputChat";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.Chat;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
// PlayerInputControl.PlayerActions
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a63f66ee0a384cf0a163c33dfa2f3c36
|
||||
timeCreated: 1750308320
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputHelpSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputHelp";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.Help;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b77e15344964a9ab0b1ecafcad3d03d
|
||||
timeCreated: 1750308298
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputSubBobSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputSubBob";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.SubBob;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea72a2c910474d5ca4e96d2c881797d8
|
||||
timeCreated: 1750307386
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputToBagSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputToBag";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.ToBag;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 906eac0772874939a5223e1115d5dfe0
|
||||
timeCreated: 1750308244
|
||||
@@ -0,0 +1,19 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputUseTelescopeSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputUseTelescope";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.UseTelescope;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24089404fdb7424284ecafcd23d1537f
|
||||
timeCreated: 1750308215
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
public class InputUseTorchSetting : KeyBoardOption
|
||||
{
|
||||
public override string Name => "InputUseTorch";
|
||||
public override string Group => SettingsDef.Group.Keyboard;
|
||||
public override string Tab => SettingsDef.Tab.Keyboard;
|
||||
|
||||
public override InputAction InputAction => InputManager.PlayerInputControl.Player.UseTorch;
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12a79769a6534afa8212293adfa1e48a
|
||||
timeCreated: 1750307422
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03ec1dd2a17344dcb27d9f06c7dbbc34
|
||||
timeCreated: 1748590602
|
||||
@@ -0,0 +1,48 @@
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(100)]
|
||||
public class LanguageSetting : MultiOption<int>
|
||||
{
|
||||
private int _defaultLanguage;
|
||||
public override string Name => "Language";
|
||||
public override string Group => SettingsDef.Group.Language;
|
||||
|
||||
public override string Tab => SettingsDef.Tab.SoundAndLanguage;
|
||||
|
||||
protected override int DefaultValue => (int)_defaultLanguage;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
var list = LanguageConst.LanguageList;
|
||||
var systemLanguage = Application.systemLanguage;
|
||||
var systemIndex = list.FindIndex(t => t.Language == systemLanguage);
|
||||
if (systemIndex < 0)
|
||||
{
|
||||
systemIndex = 0;
|
||||
}
|
||||
|
||||
_defaultLanguage = (int)Lan.Inst.GetCurrentLanguage();
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var lang = list[i];
|
||||
AddOption(lang.Name, i);
|
||||
}
|
||||
|
||||
_defaultLanguage = systemIndex;
|
||||
var current = GetValue();
|
||||
if (current < 0 || current >= LanguageConst.LanguageList.Count)
|
||||
{
|
||||
SetValue(_defaultLanguage);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
var lang = LanguageConst.LanguageList[GetValue()];
|
||||
Lan.Inst.UseLanguage(lang.Language);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6eb19d962e5644ada69dca074c6e720a
|
||||
timeCreated: 1748592356
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab9087f7f0a74aaa8a8824e2ec55657d
|
||||
timeCreated: 1749537412
|
||||
@@ -0,0 +1,26 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(3)]
|
||||
public class AmbientVolumeSetting : RangeOption
|
||||
{
|
||||
public override string Name => "AmbientVolume";
|
||||
public override string Group => SettingsDef.Group.Sound;
|
||||
public override string Tab => SettingsDef.Tab.SoundAndLanguage;
|
||||
public override int MinValue => 0;
|
||||
public override int MaxValue => 100;
|
||||
|
||||
protected override int DefaultValue => 100;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
// SetValue(10);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
SoundManager.Inst.SetVolume(AudioChannelType.Ambient, GetValue() / 100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e841f4c4a4954318b67235033e58576b
|
||||
timeCreated: 1749537896
|
||||
@@ -0,0 +1,26 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(1)]
|
||||
public class MasterVolumeSetting : RangeOption
|
||||
{
|
||||
public override string Name => "MasterVolume";
|
||||
public override string Group => SettingsDef.Group.Sound;
|
||||
public override string Tab => SettingsDef.Tab.SoundAndLanguage;
|
||||
public override int MinValue => 0;
|
||||
public override int MaxValue => 100;
|
||||
|
||||
protected override int DefaultValue => 100;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
// SetValue(10);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
SoundManager.Inst.SetMasterVolume(GetValue() / 100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e2fca480fb44b0a8d38fd15d2ef1413
|
||||
timeCreated: 1749537486
|
||||
@@ -0,0 +1,26 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(2)]
|
||||
public class PlayerVolumeSetting : RangeOption
|
||||
{
|
||||
public override string Name => "PlayerVolume";
|
||||
public override string Group => SettingsDef.Group.Sound;
|
||||
public override string Tab => SettingsDef.Tab.SoundAndLanguage;
|
||||
public override int MinValue => 0;
|
||||
public override int MaxValue => 100;
|
||||
|
||||
protected override int DefaultValue => 100;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
// SetValue(10);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
SoundManager.Inst.SetVolume(AudioChannelType.Player, GetValue() / 100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f421f4166fe4bd3a31c78f5a8e47364
|
||||
timeCreated: 1749537942
|
||||
@@ -0,0 +1,26 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF.Setting
|
||||
{
|
||||
[Sort(4)]
|
||||
public class UIVolumeSetting : RangeOption
|
||||
{
|
||||
public override string Name => "UIVolume";
|
||||
public override string Group => SettingsDef.Group.Sound;
|
||||
public override string Tab => SettingsDef.Tab.SoundAndLanguage;
|
||||
public override int MinValue => 0;
|
||||
public override int MaxValue => 100;
|
||||
|
||||
protected override int DefaultValue => 100;
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
// SetValue(10);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
SoundManager.Inst.SetVolume(AudioChannelType.UI, GetValue() / 100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a63098af5bd4b36929f75a58e2a5159
|
||||
timeCreated: 1749537834
|
||||
Reference in New Issue
Block a user