本文整理汇总了C++中UClass::GetAuthoritativeClass方法的典型用法代码示例。如果您正苦于以下问题:C++ UClass::GetAuthoritativeClass方法的具体用法?C++ UClass::GetAuthoritativeClass怎么用?C++ UClass::GetAuthoritativeClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UClass
的用法示例。
在下文中一共展示了UClass::GetAuthoritativeClass方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PreEditUndo
void AActor::PreEditUndo()
{
// Check if this Actor needs to be re-instanced
UClass* OldClass = GetClass();
UClass* NewClass = OldClass->GetAuthoritativeClass();
if (NewClass != OldClass)
{
// Empty the OwnedComponents array, it's filled with invalid information
OwnedComponents.Empty();
}
// Since child actor components will rebuild themselves get rid of the Actor before we make changes
TInlineComponentArray<UChildActorComponent*> ChildActorComponents;
GetComponents(ChildActorComponents);
for (UChildActorComponent* ChildActorComponent : ChildActorComponents)
{
if (ChildActorComponent->IsCreatedByConstructionScript())
{
ChildActorComponent->DestroyChildActor();
}
}
// let navigation system know to not care about this actor anymore
UNavigationSystem::ClearNavOctreeAll(this);
Super::PreEditUndo();
}
示例2: FindPin
void UK2Node_Variable::AutowireNewNode(UEdGraphPin* FromPin)
{
const UEdGraphSchema_K2* K2Schema = CastChecked<UEdGraphSchema_K2>(GetSchema());
// Do some auto-connection
if (FromPin != NULL)
{
bool bConnected = false;
if(FromPin->Direction == EGPD_Output)
{
// If the source pin has a valid PinSubCategoryObject, we might be doing BP Comms, so check if it is a class
if(FromPin->PinType.PinSubCategoryObject.IsValid() && FromPin->PinType.PinSubCategoryObject->IsA(UClass::StaticClass()))
{
UProperty* VariableProperty = VariableReference.ResolveMember<UProperty>(GetBlueprintClassFromNode());
if(VariableProperty)
{
UClass* PropertyOwner = VariableProperty->GetOwnerClass();
if (PropertyOwner != nullptr)
{
PropertyOwner = PropertyOwner->GetAuthoritativeClass();
}
// BP Comms is highly likely at this point, if the source pin's type is a child of the variable's owner class, let's conform the "Target" pin
if(FromPin->PinType.PinSubCategoryObject == PropertyOwner || dynamic_cast<UClass*>(FromPin->PinType.PinSubCategoryObject.Get())->IsChildOf(PropertyOwner))
{
UEdGraphPin* TargetPin = FindPin(K2Schema->PN_Self);
if (TargetPin)
{
TargetPin->PinType.PinSubCategoryObject = PropertyOwner;
if(K2Schema->TryCreateConnection(FromPin, TargetPin))
{
bConnected = true;
// Setup the VariableReference correctly since it may no longer be a self member
VariableReference.SetFromField<UProperty>(GetPropertyForVariable(), false);
TargetPin->bHidden = false;
FromPin->GetOwningNode()->NodeConnectionListChanged();
this->NodeConnectionListChanged();
}
}
}
}
}
}
if(!bConnected)
{
Super::AutowireNewNode(FromPin);
}
}
}
示例3: GetAuthoritativeBlueprintClass
// @todo: move this to FKismetEditorUtilities
static UClass* GetAuthoritativeBlueprintClass(UBlueprint const* const Blueprint)
{
UClass* BpClass = (Blueprint->SkeletonGeneratedClass != nullptr) ? Blueprint->SkeletonGeneratedClass :
Blueprint->GeneratedClass;
if (BpClass == nullptr)
{
BpClass = Blueprint->ParentClass;
}
UClass* AuthoritativeClass = BpClass;
if (BpClass != nullptr)
{
AuthoritativeClass = BpClass->GetAuthoritativeClass();
}
return AuthoritativeClass;
}
示例4: if
void UK2Node_Variable::CreatePinForSelf()
{
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
// Create the self pin
if (!K2Schema->FindSelfPin(*this, EGPD_Input))
{
// Do not create a self pin for locally scoped variables
if( !VariableReference.IsLocalScope() )
{
bool bSelfTarget = VariableReference.IsSelfContext() && (ESelfContextInfo::NotSelfContext != SelfContextInfo);
UClass* MemberParentClass = VariableReference.GetMemberParentClass(GetBlueprintClassFromNode());
UClass* TargetClass = MemberParentClass;
// Self Target pins should always make the class be the owning class of the property,
// so if the node is from a Macro Blueprint, it will hook up as self in any placed Blueprint
if(bSelfTarget)
{
if(UProperty* Property = VariableReference.ResolveMember<UProperty>(GetBlueprintClassFromNode()))
{
TargetClass = Property->GetOwnerClass()->GetAuthoritativeClass();
}
else
{
TargetClass = GetBlueprint()->SkeletonGeneratedClass->GetAuthoritativeClass();
}
}
else if(MemberParentClass && MemberParentClass->ClassGeneratedBy)
{
TargetClass = MemberParentClass->GetAuthoritativeClass();
}
UEdGraphPin* TargetPin = CreatePin(EGPD_Input, K2Schema->PC_Object, TEXT(""), TargetClass, false, false, K2Schema->PN_Self);
TargetPin->PinFriendlyName = LOCTEXT("Target", "Target");
if (bSelfTarget)
{
TargetPin->bHidden = true; // don't show in 'self' context
}
}
}
else
{
//@TODO: Check that the self pin types match!
}
}
示例5:
void UK2Node_CallParentFunction::SetFromFunction(const UFunction* Function)
{
if (Function != NULL)
{
bIsPureFunc = Function->HasAnyFunctionFlags(FUNC_BlueprintPure);
bIsConstFunc = Function->HasAnyFunctionFlags(FUNC_Const);
UClass* OwnerClass = Function->GetOwnerClass();
FGuid FunctionGuid;
if (OwnerClass != nullptr)
{
OwnerClass = OwnerClass->GetAuthoritativeClass();
UBlueprint::GetGuidFromClassByFieldName<UFunction>(OwnerClass, Function->GetFName(), FunctionGuid);
}
FunctionReference.SetDirect(Function->GetFName(), FunctionGuid, OwnerClass, /*bIsConsideredSelfContext =*/false);
}
}
示例6: PostEditUndo
void AActor::PostEditUndo(TSharedPtr<ITransactionObjectAnnotation> TransactionAnnotation)
{
CurrentTransactionAnnotation = StaticCastSharedPtr<FActorTransactionAnnotation>(TransactionAnnotation);
// Check if this Actor needs to be re-instanced
UClass* OldClass = GetClass();
if (OldClass->HasAnyClassFlags(CLASS_NewerVersionExists))
{
UClass* NewClass = OldClass->GetAuthoritativeClass();
if (!ensure(NewClass != OldClass))
{
UE_LOG(LogActor, Warning, TEXT("WARNING: %s is out of date and is the same as its AuthoritativeClass during PostEditUndo!"), *OldClass->GetName());
};
// Early exit, letting anything more occur would be invalid due to the REINST_ class
return;
}
// Notify LevelBounds actor that level bounding box might be changed
if (!IsTemplate())
{
GetLevel()->MarkLevelBoundsDirty();
}
// Restore OwnedComponents array
if (!IsPendingKill())
{
ResetOwnedComponents();
// notify navigation system
UNavigationSystem::UpdateActorAndComponentsInNavOctree(*this);
}
else
{
UNavigationSystem::ClearNavOctreeAll(this);
}
Super::PostEditUndo(TransactionAnnotation);
}
示例7:
UFunction* UK2Node_BaseMCDelegate::GetDelegateSignature(bool bForceNotFromSkelClass) const
{
FMemberReference ReferenceToUse;
if(!bForceNotFromSkelClass)
{
ReferenceToUse = DelegateReference;
}
else
{
UClass* OwnerClass = DelegateReference.GetMemberParentClass(this);
FGuid DelegateGuid;
if (OwnerClass)
{
UBlueprint::GetGuidFromClassByFieldName<UFunction>(OwnerClass, DelegateReference.GetMemberName(), DelegateGuid);
}
ReferenceToUse.SetDirect(DelegateReference.GetMemberName(), DelegateGuid, OwnerClass ? OwnerClass->GetAuthoritativeClass() : NULL, false);
}
UMulticastDelegateProperty* DelegateProperty = ReferenceToUse.ResolveMember<UMulticastDelegateProperty>(this);
return (DelegateProperty != NULL) ? DelegateProperty->SignatureFunction : NULL;
}