ue设置某个actor不参与multiuser

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ue设置某个actor不参与multiuser相关的知识,希望对你有一定的参考价值。

查看/修改一个对象的时候,我们都是在编辑器中打开地图,然后选中地图中的一个actor,右侧就会自动出现该actor对应的属性列表。
下面是一个选中一个Actor对象时创建对应更新属性对象的调用链。可以看到,当选中一个Actor对象时,对于该对象的属性遍历是自动进行。由于UE支持C++反射,所以给出一个Actor对象时,就可以遍历这个对象的所有Property。
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::FPropertyValueImpl(TSharedPtr<FPropertyNode,0> InPropertyNode, FNotifyHook * InNotifyHook, TSharedPtr<IPropertyUtilities,0> InPropertyUtilities) 行 48 C++
UE4Editor-PropertyEditor.dll!FPropertyHandleBase::FPropertyHandleBase(TSharedPtr<FPropertyNode,0> PropertyNode, FNotifyHook * NotifyHook, TSharedPtr<IPropertyUtilities,0> PropertyUtilities) 行 2138 C++
[内联框架] UE4Editor-PropertyEditor.dll!FPropertyHandleArray::ctor(TSharedRef<FPropertyNode,0>) 行 3298 C++
UE4Editor-PropertyEditor.dll!PropertyEditorHelpers::GetPropertyHandle(TSharedRef<FPropertyNode,0> PropertyNode, FNotifyHook * NotifyHook, TSharedPtr<IPropertyUtilities,0> PropertyUtilities) 行 593 C++
UE4Editor-PropertyEditor.dll!DetailLayoutHelpers::UpdateSinglePropertyMapRecursive(FPropertyNode & InNode, FName CurCategory, FComplexPropertyNode * CurObjectNode, DetailLayoutHelpers::FUpdatePropertyMapArgs & InUpdateArgs) 行 120 C++
UE4Editor-PropertyEditor.dll!DetailLayoutHelpers::UpdateSinglePropertyMapRecursive(FPropertyNode & InNode, FName CurCategory, FComplexPropertyNode * CurObjectNode, DetailLayoutHelpers::FUpdatePropertyMapArgs & InUpdateArgs) 行 64 C++
UE4Editor-PropertyEditor.dll!SDetailsViewBase::UpdateSinglePropertyMap(TSharedPtr<FComplexPropertyNode,0> InRootPropertyNode, FDetailLayoutData & LayoutData, bool bIsExternal) 行 403 C++
UE4Editor-PropertyEditor.dll!SDetailsViewBase::UpdatePropertyMaps() 行 373 C++
UE4Editor-PropertyEditor.dll!SDetailsView::PostSetObject(const TArray<FDetailsViewObjectRoot,TSizedDefaultAllocator<32>> & Roots) 行 870 C++
UE4Editor-PropertyEditor.dll!SDetailsView::SetObjectArrayPrivate(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects) 行 650 C++
UE4Editor-PropertyEditor.dll!SDetailsView::SetObjects(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, bool bForceRefresh, bool bOverrideLock) 行 416 C++
UE4Editor-LevelEditor.dll!SActorDetails::SetObjects(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, bool bForceRefresh) 行 239 C++
UE4Editor-LevelEditor.dll!SLevelEditor::OnActorSelectionChanged(const TArray<UObject *,TSizedDefaultAllocator<32>> & NewSelection, bool bForceRefresh) 行 1753 C++
[内联框架] UE4Editor-LevelEditor.dll!Invoke(void(SLevelEditor::*)(const TArray<UObject *,TSizedDefaultAllocator<32>> &, bool)) 行 65 C++
[内联框架] UE4Editor-LevelEditor.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SLevelEditor::*)(const TArray<UObject *,TSizedDefaultAllocator<32>> &, bool) &) 行 299 C++
UE4Editor-LevelEditor.dll!TBaseSPMethodDelegateInstance<0,SLevelEditor,0,void __cdecl(TArray<UObject *,TSizedDefaultAllocator<32>> const &,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe(const TArray<UObject *,TSizedDefaultAllocator<32>> & <Params_0>, bool <Params_1>) 行 307 C++
[内联框架] UE4Editor-LevelEditor.dll!TMulticastDelegate<void __cdecl(TArray<UObject *,TSizedDefaultAllocator<32>> const &,bool),FDefaultDelegateUserPolicy>::Broadcast(const TArray<UObject *,TSizedDefaultAllocator<32>> &) 行 955 C++
UE4Editor-LevelEditor.dll!FLevelEditorModule::BroadcastActorSelectionChanged(const TArray<UObject *,TSizedDefaultAllocator<32>> & NewSelection, bool bForceRefresh) 行 447 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::UpdateFloatingPropertyWindowsFromActorList(const TArray<UObject *,TSizedDefaultAllocator<32>> & ActorList, bool bForceRefresh) 行 64 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::UpdateFloatingPropertyWindows(bool bForceRefresh) 行 55 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::NoteSelectionChange(bool bNotify) 行 417 C++
UE4Editor-SceneOutliner.dll!SceneOutliner::SSceneOutliner::OnOutlinerTreeSelectionChanged(TSharedPtr<SceneOutliner::ITreeItem,0> TreeItem, ESelectInfo::Type SelectInfo) 行 3367 C++
[内联框架] UE4Editor-SceneOutliner.dll!Invoke(void(SceneOutliner::SSceneOutliner::*)(TSharedPtr<SceneOutliner::ITreeItem,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-SceneOutliner.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SceneOutliner::SSceneOutliner::*)(TSharedPtr<SceneOutliner::ITreeItem,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-SceneOutliner.dll!TBaseSPMethodDelegateInstance<0,SceneOutliner::SSceneOutliner,0,void __cdecl(TSharedPtr<SceneOutliner::ITreeItem,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<SceneOutliner::ITreeItem,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
[内联框架] UE4Editor-SceneOutliner.dll!TDelegate<void __cdecl(TSharedPtr<SceneOutliner::ITreeItem,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound(TSharedPtr<SceneOutliner::ITreeItem,0>) 行 599 C++
UE4Editor-SceneOutliner.dll!SListView<TSharedPtr<SceneOutliner::ITreeItem,0>>::Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) 行 947 C++
UE4Editor-SceneOutliner.dll!STreeView<TSharedPtr<SceneOutliner::ITreeItem,0>>::Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) 行 501 C++
UE4Editor-SceneOutliner.dll!STableRow<TSharedPtr<SceneOutliner::ITreeItem,0>>::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) 行 617 C++
UE4Editor-SceneOutliner.dll!SceneOutliner::SSceneOutlinerTreeRow::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) 行 263 C++
[内联框架] UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee>::operator()(const FArrangedWidget &) 行 4829 C++
UE4Editor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_345a5758a2260d3d061d4759ff6c6cee>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) 行 378 C++
UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) 行 4815 C++
UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) 行 5356 C++

二、哪些内容会被展示

这里遍历的是一个对象的所有属性(Property)
void SDetailsViewBase::UpdatePropertyMaps()

……
for(int32 RootNodeIndex = 0; RootNodeIndex < RootPropertyNodes.Num(); ++RootNodeIndex)

FDetailLayoutData& LayoutData = DetailLayouts[RootNodeIndex];
UpdateSinglePropertyMap(RootPropertyNodes[RootNodeIndex], LayoutData, false);

……


三、Property从哪里来
例如一个AActor声明中的UpdateOverlapsMethodDuringLevelStreaming变量,在C++声明前面添加了UPROPERTY,所以UHT会为该对象生成对应的Property声明。并且由于声明了它的Category=Collision,所以它在面板中也是展示在Collsion页签分类中。
UCLASS(BlueprintType, Blueprintable, config=Engine, meta=(ShortTooltip="An Actor is an object that can be placed or spawned in the world."))
class ENGINE_API AActor : public UObject

……
UPROPERTY(Category=Collision, EditAnywhere)
EActorUpdateOverlapsMethod UpdateOverlapsMethodDuringLevelStreaming;
……


四、展示的内容修改后如何更新到内存对象
简单来看,界面中变量修改写回内存对象也是基于Property这个结构来完成,调用这个对象的importXXX接口来修改对象在内存中的值。
UE4Editor-CoreUObject.dll!FByteProperty::ImportText_Internal(const wchar_t * InBuffer, void * Data, int PortFlags, UObject * Parent, FOutputDevice * ErrorText) 行 397 C++
UE4Editor-CoreUObject.dll!FProperty::ImportText(const wchar_t * Buffer, void * Data, int PortFlags, UObject * OwnerObject, FOutputDevice * ErrorText) 行 351 C++
[内联框架] UE4Editor-PropertyEditor.dll!FPropertyTextUtilities::TextToPropertyHelper(const wchar_t * ValueAddress, const FPropertyNode *) 行 63 C++
UE4Editor-PropertyEditor.dll!FPropertyTextUtilities::TextToPropertyHelper(const wchar_t * Buffer, const FPropertyNode * InPropertyNode, const FProperty * Property, const FObjectBaseAddress & ObjectAddress) 行 75 C++
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::ImportText(const TArray<FObjectBaseAddress,TSizedDefaultAllocator<32>> & InObjects, const TArray<FString,TSizedDefaultAllocator<32>> & InValues, FPropertyNode * InPropertyNode, unsigned int Flags) 行 444 C++
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::ImportText(const FString & InValue, FPropertyNode * InPropertyNode, unsigned int Flags) 行 269 C++
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::SetValueAsString(const FString & InValue, unsigned int Flags) 行 796 C++
UE4Editor-PropertyEditor.dll!SPropertyEditorCombo::SendToObjects(const FString & NewValue) 行 255 C++
UE4Editor-PropertyEditor.dll!SPropertyEditorCombo::OnComboSelectionChanged(TSharedPtr<FString,0> NewValue, ESelectInfo::Type SelectInfo) 行 195 C++
[内联框架] UE4Editor-PropertyEditor.dll!Invoke(void(SPropertyEditorCombo::*)(TSharedPtr<FString,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-PropertyEditor.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SPropertyEditorCombo::*)(TSharedPtr<FString,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-PropertyEditor.dll!TBaseSPMethodDelegateInstance<0,SPropertyEditorCombo,0,void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
[内联框架] UE4Editor-PropertyEditor.dll!TDelegate<void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound(TSharedPtr<FString,0>) 行 599 C++
UE4Editor-PropertyEditor.dll!SPropertyComboBox::OnSelectionChangedInternal(TSharedPtr<FString,0> InSelectedItem, ESelectInfo::Type SelectInfo) 行 123 C++
[内联框架] UE4Editor-PropertyEditor.dll!Invoke(void(SPropertyComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-PropertyEditor.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SPropertyComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-PropertyEditor.dll!TBaseSPMethodDelegateInstance<0,SPropertyComboBox,0,void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
UE4Editor-EditorWidgets.dll!TDelegate<void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 599 C++
UE4Editor-EditorWidgets.dll!SSearchableComboBox::OnSelectionChanged_Internal(TSharedPtr<FString,0> ProposedSelection, ESelectInfo::Type SelectInfo) 行 211 C++
[内联框架] UE4Editor-EditorWidgets.dll!Invoke(void(SSearchableComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-EditorWidgets.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SSearchableComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-EditorWidgets.dll!TBaseSPMethodDelegateInstance<0,SSearchableComboBox,0,void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
UE4Editor-EditorWidgets.dll!TDelegate<void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 599 C++
UE4Editor-EditorWidgets.dll!SListView<TSharedPtr<FString,0>>::Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) 行 947 C++
UE4Editor-EditorWidgets.dll!STableRow<TSharedPtr<FString,0>>::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) 行 617 C++
[内联框架] UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee>::operator()(const FArrangedWidget &) 行 4829 C++
UE4Editor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_345a5758a2260d3d061d4759ff6c6cee>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) 行 378 C++
UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) 行 4815 C++
UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) 行 5356 C++
UE4Editor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const FVector2D CursorPos) 行 5321 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) 行 2174 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,0> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) 行 2638 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) 行 1042 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) 行 874 C++

五、总结
简单来说,就是actor对应的Details面板中的属性主要是该Actor和它的组件(Component)中的属性列表。UE提供了一种通用的机制,只要在声明中添加了UPROPERTY属性,编辑器会自动展示这些属性,通过界面修改之后会自动修改内存对象对应属性成员。

相关阅读:
Yii常用路径说明
php-redis中文文档
PHP 判断客户端是ios还是android
yiii 框架登录 判断是否是游客模式及未登录状态
php实现数字格式化,数字每三位加逗号的功能函数
php array_udiff_uassoc比较数组的键值与值
php--数组函数array
安装Postman
vue指令
vue 错误记录
参考技术A 查看/修改一个对象的时候,我们都是在编辑器中打开地图,然后选中地图中的一个actor,右侧就会自动出现该actor对应的属性列表。
下面是一个选中一个Actor对象时创建对应更新属性对象的调用链。可以看到,当选中一个Actor对象时,对于该对象的属性遍历是自动进行。由于UE支持C++反射,所以给出一个Actor对象时,就可以遍历这个对象的所有Property。
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::FPropertyValueImpl(TSharedPtr<FPropertyNode,0> InPropertyNode, FNotifyHook * InNotifyHook, TSharedPtr<IPropertyUtilities,0> InPropertyUtilities) 行 48 C++
UE4Editor-PropertyEditor.dll!FPropertyHandleBase::FPropertyHandleBase(TSharedPtr<FPropertyNode,0> PropertyNode, FNotifyHook * NotifyHook, TSharedPtr<IPropertyUtilities,0> PropertyUtilities) 行 2138 C++
[内联框架] UE4Editor-PropertyEditor.dll!FPropertyHandleArray::ctor(TSharedRef<FPropertyNode,0>) 行 3298 C++
UE4Editor-PropertyEditor.dll!PropertyEditorHelpers::GetPropertyHandle(TSharedRef<FPropertyNode,0> PropertyNode, FNotifyHook * NotifyHook, TSharedPtr<IPropertyUtilities,0> PropertyUtilities) 行 593 C++
UE4Editor-PropertyEditor.dll!DetailLayoutHelpers::UpdateSinglePropertyMapRecursive(FPropertyNode & InNode, FName CurCategory, FComplexPropertyNode * CurObjectNode, DetailLayoutHelpers::FUpdatePropertyMapArgs & InUpdateArgs) 行 120 C++
UE4Editor-PropertyEditor.dll!DetailLayoutHelpers::UpdateSinglePropertyMapRecursive(FPropertyNode & InNode, FName CurCategory, FComplexPropertyNode * CurObjectNode, DetailLayoutHelpers::FUpdatePropertyMapArgs & InUpdateArgs) 行 64 C++
UE4Editor-PropertyEditor.dll!SDetailsViewBase::UpdateSinglePropertyMap(TSharedPtr<FComplexPropertyNode,0> InRootPropertyNode, FDetailLayoutData & LayoutData, bool bIsExternal) 行 403 C++
UE4Editor-PropertyEditor.dll!SDetailsViewBase::UpdatePropertyMaps() 行 373 C++
UE4Editor-PropertyEditor.dll!SDetailsView::PostSetObject(const TArray<FDetailsViewObjectRoot,TSizedDefaultAllocator<32>> & Roots) 行 870 C++
UE4Editor-PropertyEditor.dll!SDetailsView::SetObjectArrayPrivate(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects) 行 650 C++
UE4Editor-PropertyEditor.dll!SDetailsView::SetObjects(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, bool bForceRefresh, bool bOverrideLock) 行 416 C++
UE4Editor-LevelEditor.dll!SActorDetails::SetObjects(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, bool bForceRefresh) 行 239 C++
UE4Editor-LevelEditor.dll!SLevelEditor::OnActorSelectionChanged(const TArray<UObject *,TSizedDefaultAllocator<32>> & NewSelection, bool bForceRefresh) 行 1753 C++
[内联框架] UE4Editor-LevelEditor.dll!Invoke(void(SLevelEditor::*)(const TArray<UObject *,TSizedDefaultAllocator<32>> &, bool)) 行 65 C++
[内联框架] UE4Editor-LevelEditor.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SLevelEditor::*)(const TArray<UObject *,TSizedDefaultAllocator<32>> &, bool) &) 行 299 C++
UE4Editor-LevelEditor.dll!TBaseSPMethodDelegateInstance<0,SLevelEditor,0,void __cdecl(TArray<UObject *,TSizedDefaultAllocator<32>> const &,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe(const TArray<UObject *,TSizedDefaultAllocator<32>> & <Params_0>, bool <Params_1>) 行 307 C++
[内联框架] UE4Editor-LevelEditor.dll!TMulticastDelegate<void __cdecl(TArray<UObject *,TSizedDefaultAllocator<32>> const &,bool),FDefaultDelegateUserPolicy>::Broadcast(const TArray<UObject *,TSizedDefaultAllocator<32>> &) 行 955 C++
UE4Editor-LevelEditor.dll!FLevelEditorModule::BroadcastActorSelectionChanged(const TArray<UObject *,TSizedDefaultAllocator<32>> & NewSelection, bool bForceRefresh) 行 447 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::UpdateFloatingPropertyWindowsFromActorList(const TArray<UObject *,TSizedDefaultAllocator<32>> & ActorList, bool bForceRefresh) 行 64 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::UpdateFloatingPropertyWindows(bool bForceRefresh) 行 55 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::NoteSelectionChange(bool bNotify) 行 417 C++
UE4Editor-SceneOutliner.dll!SceneOutliner::SSceneOutliner::OnOutlinerTreeSelectionChanged(TSharedPtr<SceneOutliner::ITreeItem,0> TreeItem, ESelectInfo::Type SelectInfo) 行 3367 C++
[内联框架] UE4Editor-SceneOutliner.dll!Invoke(void(SceneOutliner::SSceneOutliner::*)(TSharedPtr<SceneOutliner::ITreeItem,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-SceneOutliner.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SceneOutliner::SSceneOutliner::*)(TSharedPtr<SceneOutliner::ITreeItem,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-SceneOutliner.dll!TBaseSPMethodDelegateInstance<0,SceneOutliner::SSceneOutliner,0,void __cdecl(TSharedPtr<SceneOutliner::ITreeItem,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<SceneOutliner::ITreeItem,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
[内联框架] UE4Editor-SceneOutliner.dll!TDelegate<void __cdecl(TSharedPtr<SceneOutliner::ITreeItem,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound(TSharedPtr<SceneOutliner::ITreeItem,0>) 行 599 C++
UE4Editor-SceneOutliner.dll!SListView<TSharedPtr<SceneOutliner::ITreeItem,0>>::Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) 行 947 C++
UE4Editor-SceneOutliner.dll!STreeView<TSharedPtr<SceneOutliner::ITreeItem,0>>::Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) 行 501 C++
UE4Editor-SceneOutliner.dll!STableRow<TSharedPtr<SceneOutliner::ITreeItem,0>>::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) 行 617 C++
UE4Editor-SceneOutliner.dll!SceneOutliner::SSceneOutlinerTreeRow::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) 行 263 C++
[内联框架] UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee>::operator()(const FArrangedWidget &) 行 4829 C++
UE4Editor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_345a5758a2260d3d061d4759ff6c6cee>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) 行 378 C++
UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) 行 4815 C++
UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) 行 5356 C++
二、哪些内容会被展示
这里遍历的是一个对象的所有属性(Property)
void SDetailsViewBase::UpdatePropertyMaps()

……
for(int32 RootNodeIndex = 0; RootNodeIndex < RootPropertyNodes.Num(); ++RootNodeIndex)

FDetailLayoutData& LayoutData = DetailLayouts[RootNodeIndex];
UpdateSinglePropertyMap(RootPropertyNodes[RootNodeIndex], LayoutData, false);

……

三、Property从哪里来
例如一个AActor声明中的UpdateOverlapsMethodDuringLevelStreaming变量,在C++声明前面添加了UPROPERTY,所以UHT会为该对象生成对应的Property声明。并且由于声明了它的Category=Collision,所以它在面板中也是展示在Collsion页签分类中。
UCLASS(BlueprintType, Blueprintable, config=Engine, meta=(ShortTooltip="An Actor is an object that can be placed or spawned in the world."))
class ENGINE_API AActor : public UObject

……
UPROPERTY(Category=Collision, EditAnywhere)
EActorUpdateOverlapsMethod UpdateOverlapsMethodDuringLevelStreaming;
……

四、展示的内容修改后如何更新到内存对象
简单来看,界面中变量修改写回内存对象也是基于Property这个结构来完成,调用这个对象的importXXX接口来修改对象在内存中的值。
UE4Editor-CoreUObject.dll!FByteProperty::ImportText_Internal(const wchar_t * InBuffer, void * Data, int PortFlags, UObject * Parent, FOutputDevice * ErrorText) 行 397 C++
UE4Editor-CoreUObject.dll!FProperty::ImportText(const wchar_t * Buffer, void * Data, int PortFlags, UObject * OwnerObject, FOutputDevice * ErrorText) 行 351 C++
[内联框架] UE4Editor-PropertyEditor.dll!FPropertyTextUtilities::TextToPropertyHelper(const wchar_t * ValueAddress, const FPropertyNode *) 行 63 C++
UE4Editor-PropertyEditor.dll!FPropertyTextUtilities::TextToPropertyHelper(const wchar_t * Buffer, const FPropertyNode * InPropertyNode, const FProperty * Property, const FObjectBaseAddress & ObjectAddress) 行 75 C++
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::ImportText(const TArray<FObjectBaseAddress,TSizedDefaultAllocator<32>> & InObjects, const TArray<FString,TSizedDefaultAllocator<32>> & InValues, FPropertyNode * InPropertyNode, unsigned int Flags) 行 444 C++
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::ImportText(const FString & InValue, FPropertyNode * InPropertyNode, unsigned int Flags) 行 269 C++
UE4Editor-PropertyEditor.dll!FPropertyValueImpl::SetValueAsString(const FString & InValue, unsigned int Flags) 行 796 C++
UE4Editor-PropertyEditor.dll!SPropertyEditorCombo::SendToObjects(const FString & NewValue) 行 255 C++
UE4Editor-PropertyEditor.dll!SPropertyEditorCombo::OnComboSelectionChanged(TSharedPtr<FString,0> NewValue, ESelectInfo::Type SelectInfo) 行 195 C++
[内联框架] UE4Editor-PropertyEditor.dll!Invoke(void(SPropertyEditorCombo::*)(TSharedPtr<FString,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-PropertyEditor.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SPropertyEditorCombo::*)(TSharedPtr<FString,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-PropertyEditor.dll!TBaseSPMethodDelegateInstance<0,SPropertyEditorCombo,0,void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
[内联框架] UE4Editor-PropertyEditor.dll!TDelegate<void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound(TSharedPtr<FString,0>) 行 599 C++
UE4Editor-PropertyEditor.dll!SPropertyComboBox::OnSelectionChangedInternal(TSharedPtr<FString,0> InSelectedItem, ESelectInfo::Type SelectInfo) 行 123 C++
[内联框架] UE4Editor-PropertyEditor.dll!Invoke(void(SPropertyComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-PropertyEditor.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SPropertyComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-PropertyEditor.dll!TBaseSPMethodDelegateInstance<0,SPropertyComboBox,0,void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
UE4Editor-EditorWidgets.dll!TDelegate<void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 599 C++
UE4Editor-EditorWidgets.dll!SSearchableComboBox::OnSelectionChanged_Internal(TSharedPtr<FString,0> ProposedSelection, ESelectInfo::Type SelectInfo) 行 211 C++
[内联框架] UE4Editor-EditorWidgets.dll!Invoke(void(SSearchableComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type)) 行 65 C++
[内联框架] UE4Editor-EditorWidgets.dll!UE4Tuple_Private::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(SSearchableComboBox::*)(TSharedPtr<FString,0>, ESelectInfo::Type) &) 行 299 C++
UE4Editor-EditorWidgets.dll!TBaseSPMethodDelegateInstance<0,SSearchableComboBox,0,void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfSafe(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 307 C++
UE4Editor-EditorWidgets.dll!TDelegate<void __cdecl(TSharedPtr<FString,0>,enum ESelectInfo::Type),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>(TSharedPtr<FString,0> <Params_0>, ESelectInfo::Type <Params_1>) 行 599 C++
UE4Editor-EditorWidgets.dll!SListView<TSharedPtr<FString,0>>::Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) 行 947 C++
UE4Editor-EditorWidgets.dll!STableRow<TSharedPtr<FString,0>>::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) 行 617 C++
[内联框架] UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee>::operator()(const FArrangedWidget &) 行 4829 C++
UE4Editor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_345a5758a2260d3d061d4759ff6c6cee>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_345a5758a2260d3d061d4759ff6c6cee> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) 行 378 C++
UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) 行 4815 C++
UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) 行 5356 C++
UE4Editor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const FVector2D CursorPos) 行 5321 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) 行 2174 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,0> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) 行 2638 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) 行 1042 C++
UE4Editor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) 行 874 C++
五、总结
简单来说,就是actor对应的Details面板中的属性主要是该Actor和它的组件(Component)中的属性列表。UE提供了一种通用的机制,只要在声明中添加了UPROPERTY属性,编辑器会自动展示这些属性,通过界面修改之后会自动修改内存对象对应属性成员。
相关阅读:
Yii常用路径说明
PHP-redis中文文档
PHP 判断客户端是IOS还是Android
yiii 框架登录 判断是否是游客模式及未登录状态
php实现数字格式化,数字每三位加逗号的功能函数
php array_udiff_uassoc比较数组的键值与值
php--数组函数array
安装Postman
vue指令
vue 错误记录
参考技术B 查看/修改一个对象的时候,我们都是在编辑器中打开地图,然后选中地图中的一个actor,右侧就会自动出现该actor对应的属性列表。
下面是一个选中一个Actor对象时创建对应更新属性对象的调用链。可以看到,当选中一个Actor对象时,对于该对象的属性遍历是自动进行。由于UE支持C++反射,所以给出一个Actor对象时,就可以遍历这个对象的所有Property。
参考技术C 查看/修改一个对象的时候,我们都是在编辑器中打开地图,然后选中地图中的一个actor,右侧就会自动出现该actor对应的属性列表。
下面是一个选中一个Actor对象时创建对应更新属性对象的调用链。可以看到,当选中一个Actor对象时,对于该对象的属性遍历是自动进行。由于UE支持C++反射,所以给出一个Actor对象时,就可以遍历这个对象的所有Property。
参考技术D 查看/修改一个对象的时候,我们都是在编辑器中打开地图,然后选中地图中的一个actor,右侧就会自动出现该actor对应的属性列表。
下面是一个选中一个Actor对象时创建对应更新属性对象的调用链。可以看到,当选中一个Actor对象时,对于该对象的属性遍历是自动进行。由于UE支持C++反射,所以给出一个Actor对象时,就可以遍历这个对象的所有Property。

最简单的 UE 4 C++ 教程 ——两个相机视图的切换二十八

原教程是基于 UE 4.18,我是基于 UE 4.25】

英文原地址

接上一节教程,这是 Epic 的游戏控制摄像机教程的攻略教程。

创建一个名为 CameraDirector 的新角色。然后在头文件中添加三个变量。添加两个从 Actor 类继承而来的摄像机 actor。将 UPROPERTY 设置为 EditAnywhere ,这样我们就可以在编辑器中添加 actor 。这两个摄像机将是用于我们的视图切换的 actor。添加一 float 变量(表示时间),这样我就可以在 cpp 文件中使用它。下面是头文件。

CameraDirector.h

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "CameraDirector.generated.h"

UCLASS()
class UNREALCPP_API ACameraDirector : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	ACameraDirector();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// declare variables
	UPROPERTY(EditAnywhere)
	AActor* CameraOne;

	UPROPERTY(EditAnywhere)
	AActor* CameraTwo;

	float TimeToNextCameraChange;
	
};

首先,我们想要添加 Kismet/GameplayStatics.h 脚本以允许我们访问玩家控制器。

#include "CameraDirector.h"
// include Kismet/GameplayStatics.h
#include "Kismet/GameplayStatics.h"

这个 actor 的其余逻辑将被添加到 Tick 函数中。声明两个浮点变量。这两个浮动变量将管理相机变化之间的时间,以及平滑混合视图之间的时间量。

void ACameraDirector::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	const float TimeBetweenCameraChanges = 2.0f;
    const float SmoothBlendTime = 0.75f;

}

接下来,从我们在头文件中声明的 float 变量 TimeToNextCameraChange 中减去 DeltaTime

// Called every frame
void ACameraDirector::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
    
	const float TimeBetweenCameraChanges = 2.0f;
    const float SmoothBlendTime = 0.75f;
	TimeToNextCameraChange -= DeltaTime;

}

之后,我们想要检查 TimeToNextCameraChange 是否小于或等于 0。如果为 true ,则通过将 TimeBetweenCameraChanges (设置回 2 秒添加到 TimeToNextCameraChange 。通过使用 UGameplayStatics 方法 GetPlayerController 获取 PlayerController 。通过获取 PlayerController ,我们可以设置它的视图目标。我们检查视图目标是否为 CameraOne ,并根据结果适当地切换摄像机。

  • 获取玩家控制器
APlayerController* OurPlayerController = UGameplayStatics::GetPlayerController(this, 0);
  •  平滑混合地设置摄像机目标
OurPlayerController->SetViewTargetWithBlend(CameraTwo, SmoothBlendTime);
  • 直接设置摄像机目标 
OurPlayerController->SetViewTarget(CameraOne);

下面是完整的 cpp 文件

// Called every frame
void ACameraDirector::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	const float TimeBetweenCameraChanges = 2.0f;
    const float SmoothBlendTime = 0.75f;
	TimeToNextCameraChange -= DeltaTime;
	
    if (TimeToNextCameraChange <= 0.0f)
    {
        TimeToNextCameraChange += TimeBetweenCameraChanges;

        //Find the actor that handles control for the local player.
        APlayerController* OurPlayerController = UGameplayStatics::GetPlayerController(this, 0);
        if (OurPlayerController)
        {
            if (CameraTwo && (OurPlayerController->GetViewTarget() == CameraOne))
            {
                //Blend smoothly to camera two.
                OurPlayerController->SetViewTargetWithBlend(CameraTwo, SmoothBlendTime);
            }
            else if (CameraOne)
            {
                //Cut instantly to camera one.
                OurPlayerController->SetViewTarget(CameraOne);
            }
        }
    }

}

CameraDirector actor拖放到场景中。将两个摄像机(或任何 actor)拖到场景中,并将它们设置为 CameraOneCameraTwo 。现在按下播放键,你就会看到你的视图目标从一个摄像头转到另一个。

 

以上是关于ue设置某个actor不参与multiuser的主要内容,如果未能解决你的问题,请参考以下文章

最简单的 UE 4 C++ 教程 —— Actor 线轨迹(line trace)碰撞检测十七

最简单的 UE 4 C++ 教程 —— 给 Actor 添加径向推力十八

UE寻找Actor

ue4如何用蓝图实现 获取到选中Actor的路径?

UE4网络同步

UE4自学随笔