.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
Object
Path
Pin
RigVM
Scene
Script
Sequencer
Serialization
SparseDataType
String
Struct
TypePicker
UHT
FieldNotifyInterfaceParam
FieldNotifyInterfaceParam.md
Untitled.png
CppFromBpEvent.md
CustomThunk.md
DocumentationPolicy.md
IncludePath.md
ModuleRelativePath.md
NativeConstTemplateArg.md
Widget
Meta.md
Specifier
UnrealSpecifiers.md
Ue4 c++ UProperty反射 PostEditChangeProperty.md
Ue4Object生命周期.jpg
大钊提供的一种获取UE Private函数的方法.md
LevelScene
Math
Mobile
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
1.9 KiB
1.9 KiB
FieldNotifyInterfaceParam
- 功能描述: 指定函数的某个参数提供FieldNotify的ViewModel信息。
- 使用位置: UFUNCTION
- 引擎模块: FieldNotify
- 元数据类型: string="abc"
- 限制类型: 函数里有其他FFieldNotificationId 参数
- 常用程度: ★★★
指定函数的某个参数提供FieldNotify的ViewModel信息。
该参数为之后的FFieldNotificationId参数的提供上下文信息,这样FieldId的选项框才知道有哪些可选值。
源码例子:
/** Broadcast that the Field value changed. */
UFUNCTION(BlueprintCallable, Category = "FieldNotification", meta = (FieldNotifyInterfaceParam="Object", DisplayName = "Broadcast Field Value Changed"))
static void BroadcastFieldValueChanged(UObject* Object, FFieldNotificationId FieldId);
蓝图效果:
在UserWidget里测试,可见没有连接到参数的Target默认为当前的UserWidget,则FieldId是3个值。而连接到我们自定义的ViewModel后,则改变为我们下面定义的值。
原理:
TSharedRef<SWidget> SFieldNotificationGraphPin::GetDefaultValueWidget()
{
UEdGraphPin* SelfPin = GraphPinObj->GetOwningNode()->FindPin(UEdGraphSchema_K2::PSC_Self);
if (UK2Node_CallFunction* CallFunction = Cast<UK2Node_CallFunction>(GraphPinObj->GetOwningNode()))
{
if (UFunction* Function = CallFunction->GetTargetFunction())
{
const FString& PinName = Function->GetMetaData("FieldNotifyInterfaceParam");
if (PinName.Len() != 0)
{
SelfPin = GraphPinObj->GetOwningNode()->FindPin(*PinName);
}
}
}
return SNew(SFieldNotificationPicker)
.Value(this, &SFieldNotificationGraphPin::GetValue)
.OnValueChanged(this, &SFieldNotificationGraphPin::SetValue)
.FromClass_Static(Private::GetPinClass, SelfPin)
.Visibility(this, &SGraphPin::GetDefaultValueVisibility);
}