.obsidian
.vs
00-MOC
01-Diary
02-Note
03-UnrealEngine
Animation
Editor
Gameplay
AI
Animation
Code
Debug
GAS
Gameplay
Http
Lyra
Mass
Online
Other
PuerTS
UObject
UnrealSpecifiers
Flags
Meta
Actor
AnimationGraph
Asset
Blueprint
Component
Config
Container
Debug
DetailsPanel
Development
Enum
GAS
Material
Niagara
Numeric
AllowPreserveRatio
ArrayClamp
ColorGradingMode
CtrlMultiplier
Delta
HideAlphaChannel
InlineColorPicker
Multiple
NoSpinbox
ShowNormalize
SliderExponent
SupportDynamicSliderMinValue
UIMin
Units
WheelStep
ClampMax.md
ClampMin.md
ForceUnits.md
LinearDeltaSensitivity.md
ShiftMultiplier.md
SupportDynamicSliderMaxValue.md
UIMax.md
sRGB.md
Object
Path
Pin
RigVM
Scene
Script
Sequencer
Serialization
SparseDataType
String
Struct
TypePicker
UHT
Widget
Meta.md
Specifier
UnrealSpecifiers.md
Ue4 c++ UProperty反射 PostEditChangeProperty.md
Ue4Object生命周期.jpg
大钊提供的一种获取UE Private函数的方法.md
LevelScene
Math
Mobile
Physical
Plugins
Rendering
Sequence
UI
VirtualProduction
VisualEffect
卡通渲染相关资料
性能优化
流程管理与部署
.keep
03-UnrealEngine.md
04-ComputerGraphics
05-SDHGame
06-DCC
07-Other
08-Assets
09-Templates
.gitattributes
.gitignore
.gitmodules
LICENSE
2.4 KiB
2.4 KiB
LinearDeltaSensitivity
- 功能描述: 在设定Delta后,进一步设定数字输入框变成线性改变以及改变的敏感度(值越大越不敏感)
- 使用位置: UPROPERTY
- 引擎模块: Numeric Property
- 元数据类型: float/int
- 限制类型: float,int32
- 关联项: Delta
- 常用程度: ★★★
生效的条件:
- 先设置Delta>0
- 不设置UIMin, UIMax
- 设定LinearDeltaSensitivity >0
测试代码:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DeltaTest, meta = (UIMin = "0", UIMax = "1000", Delta = 10))
float MyFloat_Delta10_UIMinMax = 100;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DeltaTest, meta = (Delta = 10, LinearDeltaSensitivity = 50))
float MyFloat_Delta10_LinearDeltaSensitivity50 = 100;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DeltaTest, meta = (UIMin = "0", UIMax = "1000", Delta = 10, LinearDeltaSensitivity = 50))
float MyFloat_Delta10_LinearDeltaSensitivity50_UIMinMax = 100;
测试效果:
效果解析请参见:Delta的解析
原理:
可见只有没有UIMinMax且已经设置Delta后才能走进线性改变的代码分支。
, _Delta(0)
virtual FReply SSpinBox<NumericType>::OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override
{
if (bUnlimitedSpinRange)
{
// If this control has a specified delta and sensitivity then we use that instead of the current value for determining how much to change.
const double Sign = (MouseEvent.GetCursorDelta().X > 0) ? 1.0 : -1.0;
if (LinearDeltaSensitivity.IsSet() && LinearDeltaSensitivity.Get() != 0 && Delta.IsSet() && Delta.Get() > 0)
{
const double MouseDelta = FMath::Abs(MouseEvent.GetCursorDelta().X / (float)LinearDeltaSensitivity.Get());
NewValue = InternalValue + (Sign * MouseDelta * FMath::Pow((double)Delta.Get(), (double)SliderExponent.Get())) * Step;
}
else
{
const double MouseDelta = FMath::Abs(MouseEvent.GetCursorDelta().X / SliderWidthInSlateUnits);
const double CurrentValue = FMath::Clamp<double>(FMath::Abs(InternalValue), 1.0, (double)std::numeric_limits<NumericType>::max());
NewValue = InternalValue + (Sign * MouseDelta * FMath::Pow((double)CurrentValue, (double)SliderExponent.Get())) * Step;
}
}
}