本文整理汇总了C++中TWeakObjectPtr::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ TWeakObjectPtr::Get方法的具体用法?C++ TWeakObjectPtr::Get怎么用?C++ TWeakObjectPtr::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TWeakObjectPtr
的用法示例。
在下文中一共展示了TWeakObjectPtr::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTaskTick
void UAblRayCastQueryTask::OnTaskTick(const TWeakObjectPtr<const UAblAbilityContext>& Context, float deltaTime) const
{
Super::OnTaskTick(Context, deltaTime);
if (IsAsyncFriendly() && UAbleSettings::IsAsyncEnabled())
{
UAblRayCastQueryTaskScratchPad* ScratchPad = Cast<UAblRayCastQueryTaskScratchPad>(Context->GetScratchPadForTask(this));
check(ScratchPad);
if (!ScratchPad->AsyncProcessed && ScratchPad->AsyncHandle._Handle != 0)
{
AActor* SourceActor = m_QueryLocation.GetSourceActor(*Context.Get());
check(SourceActor);
UWorld* World = SourceActor->GetWorld();
FTraceDatum Datum;
if (World->QueryTraceData(ScratchPad->AsyncHandle, Datum))
{
if (m_CopyResultsToContext)
{
CopyResultsToContext(Datum.OutHits, Context);
}
if (m_FireEvent)
{
Context->GetAbility()->OnRaycastEvent(Context.Get(), m_Name, Datum.OutHits);
}
ScratchPad->AsyncProcessed = true;
}
}
}
}
示例2: operator
FORCEINLINE bool operator()( const TWeakObjectPtr< UObject >& Lhs, const TWeakObjectPtr< UObject >& Rhs ) const
{
const bool LhsObjectValid = Lhs.IsValid();
if ( !LhsObjectValid )
{
return true;
}
const bool RhsObjectValid = Rhs.IsValid();
if ( !RhsObjectValid )
{
return false;
}
const UStruct* const PropertyTargetType = Property->GetOwnerStruct();
const UClass* const LhsClass = Lhs->GetClass();
if ( !LhsClass->IsChildOf( PropertyTargetType ) )
{
return true;
}
const UClass* const RhsClass = Rhs->GetClass();
if ( !RhsClass->IsChildOf( PropertyTargetType ) )
{
return false;
}
typename UPropertyType::TCppType LhsValue = Property->GetPropertyValue_InContainer(Lhs.Get());
typename UPropertyType::TCppType RhsValue = Property->GetPropertyValue_InContainer(Rhs.Get());
return ComparePropertyValue( LhsValue, RhsValue );
}
示例3: MakeTransactional
/** Called to make curve owner transactional */
virtual void MakeTransactional() override
{
if (BaseSequence.IsValid())
{
BaseSequence.Get()->SetFlags(BaseSequence.Get()->GetFlags() | RF_Transactional);
}
}
示例4: PinName
FString UK2Node_Tunnel::CreateUniquePinName(FString InSourcePinName) const
{
if (GetClass() == UK2Node_Tunnel::StaticClass())
{
// When dealing with a tunnel node that is not a sub class (macro/collapsed graph entry and result), attempt to find the paired node and find a valid name between the two
TWeakObjectPtr<UK2Node_EditablePinBase> TunnelEntry;
TWeakObjectPtr<UK2Node_EditablePinBase> TunnelResult;
FBlueprintEditorUtils::GetEntryAndResultNodes(GetGraph(), TunnelEntry, TunnelResult);
if (TunnelEntry.IsValid() && TunnelResult.IsValid())
{
FString PinName(InSourcePinName);
int32 Index = 1;
while (TunnelEntry.Get()->FindPin(PinName) != nullptr || TunnelResult.Get()->FindPin(PinName) != nullptr)
{
++Index;
PinName = InSourcePinName + FString::FromInt(Index);
}
return PinName;
}
}
return Super::CreateUniquePinName(InSourcePinName);
}
示例5: ModifyOwner
/** Called to modify the owner of the curve */
virtual void ModifyOwner() override
{
if (BaseSequence.IsValid())
{
// need to rebake
BaseSequence.Get()->bNeedsRebake = true;
BaseSequence.Get()->Modify(true);
}
}
示例6:
FGESEffectSpec::FGESEffectSpec(TWeakObjectPtr<AActor> TargetIn, TWeakObjectPtr<AActor> CauserIn,
TWeakObjectPtr<AActor> InstigatorIn)
{
IIGESEffect* targetInt = Cast<IIGESEffect>(TargetIn.Get());
IIGESEffect* instigatorInt = Cast<IIGESEffect>(InstigatorIn.Get());
TargetComponent = targetInt->GetEffectComponent();
InstigatorComponent = instigatorInt->GetEffectComponent();
}
示例7: OnEditBlueprintClicked
void SDetailNameArea::OnEditBlueprintClicked( TWeakObjectPtr<UBlueprint> InBlueprint, TWeakObjectPtr<UObject> InAsset )
{
if (UBlueprint* Blueprint = InBlueprint.Get())
{
// Set the object being debugged if given an actor reference (if we don't do this before we edit the object the editor wont know we are debugging something)
if (UObject* Asset = InAsset.Get())
{
check(Asset->GetClass()->ClassGeneratedBy == Blueprint);
Blueprint->SetObjectBeingDebugged(Asset);
}
// Open the blueprint
GEditor->EditObject( Blueprint );
}
}
示例8: DrawSnappingHelpers
void FVertexSnappingImpl::DrawSnappingHelpers(const FSceneView* View,FPrimitiveDrawInterface* PDI)
{
if( ActorVertsToDraw.IsValid() )
{
float PointSize = View->IsPerspectiveProjection() ? 4.0f : 5.0f;
DrawSnapVertices( ActorVertsToDraw.Get(), PointSize, PDI );
}
for( auto It = ActorVertsToFade.CreateIterator(); It; ++It )
{
TWeakObjectPtr<AActor> Actor = It.Key();
double FadeStart = It.Value();
if( Actor.IsValid() )
{
float PointSize = View->IsPerspectiveProjection() ? 4.0f : 5.0f;
if( FApp::GetCurrentTime()-FadeStart <= VertexSnappingConstants::FadeTime )
{
PointSize = FMath::Lerp( PointSize, 0.0f, (FApp::GetCurrentTime()-FadeStart)/VertexSnappingConstants::FadeTime );
DrawSnapVertices( Actor.Get(), PointSize, PDI );
}
}
if( !Actor.IsValid() || FApp::GetCurrentTime()-FadeStart > VertexSnappingConstants::FadeTime )
{
It.RemoveCurrent();
}
}
}
示例9: if
AGameplayDebuggerPlayerManager& FGameplayDebuggerModule::GetPlayerManager(UWorld* World)
{
const int32 PurgeInvalidWorldsSize = 5;
if (PlayerManagers.Num() > PurgeInvalidWorldsSize)
{
for (TMap<TWeakObjectPtr<UWorld>, TWeakObjectPtr<AGameplayDebuggerPlayerManager> >::TIterator It(PlayerManagers); It; ++It)
{
if (!It.Key().IsValid())
{
It.RemoveCurrent();
}
else if (!It.Value().IsValid())
{
It.RemoveCurrent();
}
}
}
TWeakObjectPtr<AGameplayDebuggerPlayerManager> Manager = PlayerManagers.FindRef(World);
AGameplayDebuggerPlayerManager* ManagerOb = Manager.Get();
if (ManagerOb == nullptr)
{
ManagerOb = World->SpawnActor<AGameplayDebuggerPlayerManager>();
PlayerManagers.Add(World, ManagerOb);
}
check(ManagerOb);
return *ManagerOb;
}
示例10: ModifyOwner
/** Called to modify the owner of the curve */
virtual void ModifyOwner()
{
if (BaseSequence.IsValid())
{
BaseSequence.Get()->Modify(true);
}
}
示例11: FindIconNameForActor
FName FClassIconFinder::FindIconNameForActor( const TWeakObjectPtr<AActor>& InActor )
{
// Actor specific overrides to normal per-class icons
AActor* Actor = InActor.Get();
FName BrushName = NAME_None;
if ( Actor )
{
ABrush* Brush = Cast< ABrush >( Actor );
if ( Brush )
{
if (Brush_Add == Brush->BrushType)
{
BrushName = TEXT( "ClassIcon.BrushAdditive" );
}
else if (Brush_Subtract == Brush->BrushType)
{
BrushName = TEXT( "ClassIcon.BrushSubtractive" );
}
}
// Actor didn't specify an icon - fallback on the class icon
if ( BrushName.IsNone() )
{
BrushName = FindIconNameForClass( Actor->GetClass() );
}
}
else
{
// If the actor reference is NULL it must have been deleted
BrushName = TEXT( "ClassIcon.Deleted" );
}
return BrushName;
}
示例12: Draw
void FPaperExtractSpritesViewportClient::Draw(FViewport* Viewport, FCanvas* Canvas)
{
// Super will clear the viewport
FPaperEditorViewportClient::Draw(Viewport, Canvas);
UTexture2D* Texture = TextureBeingExtracted.Get();
if (Texture != nullptr)
{
const bool bUseTranslucentBlend = Texture->HasAlphaChannel();
// Fully stream in the texture before drawing it.
Texture->SetForceMipLevelsToBeResident(30.0f);
Texture->WaitForStreaming();
FLinearColor TextureDrawColor = Settings->TextureTint;
//FLinearColor RectOutlineColor = FLinearColor::Yellow;
const FLinearColor RectOutlineColor = Settings->OutlineColor;
const float XPos = -ZoomPos.X * ZoomAmount;
const float YPos = -ZoomPos.Y * ZoomAmount;
const float Width = Texture->GetSurfaceWidth() * ZoomAmount;
const float Height = Texture->GetSurfaceHeight() * ZoomAmount;
Canvas->DrawTile(XPos, YPos, Width, Height, 0.0f, 0.0f, 1.0f, 1.0f, TextureDrawColor, Texture->Resource, bUseTranslucentBlend);
for (FPaperExtractedSprite Sprite : ExtractedSprites)
{
DrawRectangle(Canvas, RectOutlineColor, Sprite.Rect);
}
}
}
示例13: ExecuteNewDerivedBlueprint
void FAssetTypeActions_EditorUtilityBlueprint::ExecuteNewDerivedBlueprint(TWeakObjectPtr<UEditorUtilityBlueprint> InObject)
{
if (auto Object = InObject.Get())
{
// The menu option should ONLY be available if there is only one blueprint selected, validated by the menu creation code
UBlueprint* TargetBP = Object;
UClass* TargetClass = TargetBP->GeneratedClass;
if (!FKismetEditorUtilities::CanCreateBlueprintOfClass(TargetClass))
{
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("InvalidClassToMakeBlueprintFrom", "Invalid class with which to make a Blueprint."));
return;
}
FString Name;
FString PackageName;
CreateUniqueAssetName(Object->GetOutermost()->GetName(), TEXT("_Child"), PackageName, Name);
UPackage* Package = CreatePackage(NULL, *PackageName);
if (ensure(Package))
{
// Create and init a new Blueprint
if (UBlueprint* NewBP = FKismetEditorUtilities::CreateBlueprint(TargetClass, Package, FName(*Name), BPTYPE_Normal, UEditorUtilityBlueprint::StaticClass(), UBlueprintGeneratedClass::StaticClass()))
{
FAssetEditorManager::Get().OpenEditorForAsset(NewBP);
// Notify the asset registry
FAssetRegistryModule::AssetCreated(NewBP);
// Mark the package dirty...
Package->MarkPackageDirty();
}
}
}
}
示例14:
FVisualLogEntry::FVisualLogEntry(float InTimeStamp, FVector InLocation, const UObject* Object, TArray<TWeakObjectPtr<UObject> >* Children)
{
TimeStamp = InTimeStamp;
Location = InLocation;
const AActor* AsActor = Cast<AActor>(Object);
if (AsActor)
{
AsActor->GrabDebugSnapshot(this);
}
if (Children != NULL)
{
TWeakObjectPtr<UObject>* WeakActorPtr = Children->GetData();
for (int32 Index = 0; Index < Children->Num(); ++Index, ++WeakActorPtr)
{
if (WeakActorPtr->IsValid())
{
const AActor* ChildActor = Cast<AActor>(WeakActorPtr->Get());
if (ChildActor)
{
ChildActor->GrabDebugSnapshot(this);
}
}
}
}
}
示例15: TrackingStopped
virtual void TrackingStopped() override
{
if (Widget.IsValid() && Widget->OnTrackingStopped.IsBound())
{
Widget->OnTrackingStopped.Execute(Widget.Get());
}
}