设置相关功能脚本呢

This commit is contained in:
bob
2025-05-30 17:49:12 +08:00
parent e9ad74b3ea
commit dea58270fa
62 changed files with 1164 additions and 476 deletions

View File

@@ -0,0 +1,37 @@
using UnityEngine;
using UnityEngine.Rendering.Universal;
namespace NBF.Setting
{
[Sort(5)]
public class RenderScaleSetting : RangeOptionFloat
{
public override string Name => "RenderScale";
public override string Group => SettingsDef.Group.Graphic;
public override float MinValue => 0.1f;
public override float MaxValue => 2f;
protected override void OnInitialize()
{
}
protected override void OnApply()
{
// 获取当前URP Asset
UniversalRenderPipelineAsset URPAsset =
QualitySettings.GetRenderPipelineAssetAt(QualitySettings.GetQualityLevel()) as
UniversalRenderPipelineAsset;
if (URPAsset)
{
//渲染比例
URPAsset.renderScale = GetValue();
}
}
protected override void OnReset()
{
SetValue(1);
}
}
}