本文整理汇总了C++中TSharedPtr::CanAccessComponentsMode方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::CanAccessComponentsMode方法的具体用法?C++ TSharedPtr::CanAccessComponentsMode怎么用?C++ TSharedPtr::CanAccessComponentsMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedPtr
的用法示例。
在下文中一共展示了TSharedPtr::CanAccessComponentsMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateFromObjects
void SKismetInspector::UpdateFromObjects(const TArray<UObject*>& PropertyObjects, struct FKismetSelectionInfo& SelectionInfo, const FShowDetailsOptions& Options)
{
// If we're using the unified blueprint editor, there's not an explicit point where
// we ender a kind of component editing mode, so instead, just look at what we're selecting.
// If we select a component, then enable the customization.
if ( GetDefault<UEditorExperimentalSettings>()->bUnifiedBlueprintEditor )
{
bool bEnableComponentCustomization = false;
TSharedPtr<FBlueprintEditor> BlueprintEditor = BlueprintEditorPtr.Pin();
if ( BlueprintEditor.IsValid() )
{
if ( BlueprintEditor->CanAccessComponentsMode() )
{
for ( UObject* PropertyObject : PropertyObjects )
{
if ( PropertyObject->IsA<UActorComponent>() )
{
bEnableComponentCustomization = true;
break;
}
}
}
}
EnableComponentDetailsCustomization(bEnableComponentCustomization);
}
PropertyView->OnFinishedChangingProperties().Clear();
PropertyView->OnFinishedChangingProperties().Add( UserOnFinishedChangingProperties );
if (!Options.bForceRefresh)
{
// Early out if the PropertyObjects and the SelectedObjects are the same
bool bEquivalentSets = (PropertyObjects.Num() == SelectedObjects.Num());
if (bEquivalentSets)
{
// Verify the elements of the sets are equivalent
for (int32 i = 0; i < PropertyObjects.Num(); i++)
{
if (PropertyObjects[i] != SelectedObjects[i].Get())
{
bEquivalentSets = false;
break;
}
}
}
if (bEquivalentSets)
{
return;
}
}
// Proceed to update
SelectedObjects.Empty();
for (auto ObjectIt = PropertyObjects.CreateConstIterator(); ObjectIt; ++ObjectIt)
{
if (UObject* Object = *ObjectIt)
{
if (!Object->IsValidLowLevel())
{
ensureMsg(false, TEXT("Object in KismetInspector is invalid, see TTP 281915"));
continue;
}
SelectedObjects.Add(Object);
if (USCS_Node* SCSNode = Cast<USCS_Node>(Object))
{
// Edit the component template
UActorComponent* NodeComponent = SCSNode->ComponentTemplate;
if (NodeComponent != NULL)
{
SelectionInfo.ObjectsForPropertyEditing.Add(NodeComponent);
SelectionInfo.EditableComponentTemplates.Add(NodeComponent);
}
}
else if (UK2Node* K2Node = Cast<UK2Node>(Object))
{
// Edit the component template if it exists
if (UActorComponent* Template = K2Node->GetTemplateFromNode())
{
SelectionInfo.ObjectsForPropertyEditing.Add(Template);
SelectionInfo.EditableComponentTemplates.Add(Template);
}
// See if we should edit properties of the node
if (K2Node->ShouldShowNodeProperties())
{
SelectionInfo.ObjectsForPropertyEditing.Add(Object);
}
}
else if (UActorComponent* ActorComponent = Cast<UActorComponent>(Object))
{
AActor* Owner = ActorComponent->GetOwner();
if(Owner != NULL && Owner->HasAnyFlags(RF_ClassDefaultObject))
{
// We're editing a component that's owned by a CDO, so set the CDO to the property editor (so that propagation works) and then filter to just the component property that we want to edit
//.........这里部分代码省略.........