当前位置: 首页>>代码示例>>C++>>正文


C++ TWeakObjectPtr::Get方法代码示例

本文整理汇总了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;
			}

		}
	}
}
开发者ID:zpzsoft,项目名称:zpzsoft.github.io,代码行数:34,代码来源:ablRayCastQueryTask.cpp

示例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 );
	}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:34,代码来源:PropertyTableColumn.cpp

示例3: MakeTransactional

	/** Called to make curve owner transactional */
	virtual void MakeTransactional() override
	{
		if (BaseSequence.IsValid())
		{
			BaseSequence.Get()->SetFlags(BaseSequence.Get()->GetFlags() | RF_Transactional);
		}
	}
开发者ID:VZout,项目名称:Team6UnrealEngine,代码行数:8,代码来源:SAnimTrackCurvePanel.cpp

示例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);
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:26,代码来源:K2Node_Tunnel.cpp

示例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);
		}
	}
开发者ID:VZout,项目名称:Team6UnrealEngine,代码行数:10,代码来源:SAnimTrackCurvePanel.cpp

示例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();
}
开发者ID:CollateralStudios,项目名称:ActionRPGGame,代码行数:9,代码来源:GESEffectTypes.cpp

示例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 );
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:14,代码来源:SDetailNameArea.cpp

示例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();
		}
	}
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:31,代码来源:VertexSnapping.cpp

示例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;
}
开发者ID:dineshone,项目名称:UnrealGameEngine,代码行数:30,代码来源:GameplayDebuggerModule.cpp

示例10: ModifyOwner

	/** Called to modify the owner of the curve */
	virtual void ModifyOwner()
	{
		if (BaseSequence.IsValid())
		{
			BaseSequence.Get()->Modify(true);
		}
	}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:8,代码来源:SAnimCurvePanel.cpp

示例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;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:35,代码来源:ClassIconFinder.cpp

示例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);
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:32,代码来源:SPaperExtractSpritesDialog.cpp

示例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();
			}
		}
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:35,代码来源:AssetTypeActions_EditorUtilityBlueprint.cpp

示例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);
				}
			}
		}
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:25,代码来源:VisualLoggerTypes.cpp

示例15: TrackingStopped

	virtual void TrackingStopped() override 
	{
		if (Widget.IsValid() && Widget->OnTrackingStopped.IsBound())
		{
			Widget->OnTrackingStopped.Execute(Widget.Get());
		}
	}
开发者ID:getnamo,项目名称:Unreal.js-core,代码行数:7,代码来源:JavascriptEditorViewport.cpp


注:本文中的TWeakObjectPtr::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。