我只想找到附加到蓝图的组件..
现在,我有一个 UProperty,它公开了要设置的蓝图..
UPROPERTY(EditAnywhere, BluePrintReadWrite, Category = "Associated Character")
UBlueprint* BMoveBlueprint;
然后我收到一个关于何时设置此属性的事件..
void UTaskComponent::PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) {
Super::PostEditChangeProperty(PropertyChangedEvent);
//Get the name of the property that was changed
FName PropertyName = (PropertyChangedEvent.Property != nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None;
UE_LOG(LogTemp, Warning, TEXT("Property changed: %s"), *PropertyName.ToString());
if (PropertyName == GET_MEMBER_NAME_CHECKED(UTaskComponent, BMoveBlueprint)) {
UBMoveComponent *BMoveComponent = (UBMoveComponent *) BMoveBlueprint->FindTemplateByName("BMove");
}
}
我只想找到附加到蓝图的组件。这似乎不起作用。
请指教。