This commit is contained in:
CortexCore
2023-06-05 16:25:06 +08:00
parent 9027120bb8
commit 4565ff2e35
2947 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.Universal;
using UnityEngine.UIElements;
namespace BITKit
{
public class SetRenderScale : Provider<float>
{
public UniversalRenderPipelineAsset asset;
public override float Get()
{
return asset.renderScale;
}
public override void Set(float t)
{
asset.renderScale = t;
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(SetRenderScale))]
public class SetRenderScaleInspector : BITInspector<SetRenderScale>
{
public override VisualElement CreateInspectorGUI()
{
FillDefaultInspector(root, serializedObject, true);
var slider = root.Create<Slider>();
slider.SetValueWithoutNotify(agent.asset.renderScale);
slider.label = "渲染倍数";
slider.showInputField=true;
slider.RegisterValueChangedCallback(OnValueUpdate);
return root;
}
void OnValueUpdate(ChangeEvent<float> newValueEvent)
{
BITAppForUnity.ThrowIfNotPlaying();
agent.Set(newValueEvent.newValue);
}
}
#endif
}