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


C++ TSubclassOf::GetFName方法代码示例

本文整理汇总了C++中TSubclassOf::GetFName方法的典型用法代码示例。如果您正苦于以下问题:C++ TSubclassOf::GetFName方法的具体用法?C++ TSubclassOf::GetFName怎么用?C++ TSubclassOf::GetFName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TSubclassOf的用法示例。


在下文中一共展示了TSubclassOf::GetFName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ApplyEffectSpec

FGAEffectHandle UGABlueprintLibrary::ApplyEffectSpec(const FHitResult& Target, APawn* Instigator,
	UObject* Causer, TSubclassOf<class UGAEffectSpecification> SpecIn)
{
	FGAEffectHandle ReturnHandle;
	IIGAAttributes* targetAttr = Cast<IIGAAttributes>(Target.Actor.Get());
	IIGAAttributes* instiAttr = Cast<IIGAAttributes>(Instigator);
	if (!targetAttr || !instiAttr)
		return ReturnHandle;

	UGAAttributeComponent* targetComp = targetAttr->GetAttributeComponent();
	UGAAttributeComponent* instiComp = instiAttr->GetAttributeComponent();

	FGAEffectContext context(Target.Location, Target.Actor, Causer,
		Instigator, targetComp, instiComp);
	FName EffectName;
	if (SpecIn.GetDefaultObject()->Policy.Type != EGAEffectType::Instant)
	{
		if (SpecIn.GetDefaultObject()->EffectName.CustomName)
			EffectName = SpecIn.GetDefaultObject()->EffectName.EffectName;
		else
			EffectName = SpecIn->GetFName();// Causer->GetClass()->GetFName();
	}
	ReturnHandle = instiComp->ApplyEffectToTarget(SpecIn, context, EffectName);
	return ReturnHandle;
}
开发者ID:Chooka,项目名称:ActionRPGGame,代码行数:25,代码来源:GABlueprintLibrary.cpp

示例2: RemoveCameraShake

void UCameraModifier_CameraShake::RemoveCameraShake(TSubclassOf<class UCameraShake> Shake)
{
	for (int32 i = 0; i < ActiveShakes.Num(); ++i)
	{
		if (ActiveShakes[i].SourceShakeName == Shake->GetFName())
		{
			UCameraAnimInst* AnimInst = ActiveShakes[i].AnimInst;
			if ( (AnimInst != NULL) && !AnimInst->bFinished )
			{
				CameraOwner->StopCameraAnim(AnimInst, true);
			}

			ActiveShakes.RemoveAt(i,1);
			return;
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:17,代码来源:CameraModifier_CameraShake.cpp

示例3: AddCameraShake

void UCameraModifier_CameraShake::AddCameraShake( TSubclassOf<class UCameraShake> NewShake, float Scale, ECameraAnimPlaySpace PlaySpace, FRotator UserPlaySpaceRot )
{
	if (NewShake != NULL)
	{
		if (Cast<UCameraShake>(NewShake->GetDefaultObject())->bSingleInstance)
		{
			for (int32 i = 0; i < ActiveShakes.Num(); ++i)
			{
				if (ActiveShakes[i].SourceShakeName == NewShake->GetFName())
				{
					ReinitShake(i, Scale);
					return;
				}
			}
		}

		int32 NumShakes = ActiveShakes.Num();

		// Initialize new shake and add it to the list of active shakes
		ActiveShakes.Add(InitializeShake(NewShake, Scale, PlaySpace, UserPlaySpaceRot));
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:22,代码来源:CameraModifier_CameraShake.cpp

示例4: InitializeShake

FCameraShakeInstance UCameraModifier_CameraShake::InitializeShake(TSubclassOf<class UCameraShake> NewShake, float Scale, ECameraAnimPlaySpace PlaySpace, FRotator UserPlaySpaceRot)
{
	FCameraShakeInstance Inst;
	Inst.SourceShakeName = NewShake->GetFName();

	// Create a camera shake object of class NewShake
	Inst.SourceShake = Cast<UCameraShake>(StaticConstructObject(NewShake, this));

	Inst.Scale = Scale;
	if (GEngine->IsSplitScreen(CameraOwner->GetWorld()))
	{
		Scale *= SplitScreenShakeScale;
	}

	// init oscillations
	if ( Inst.SourceShake->OscillationDuration != 0.f )
	{
		Inst.RotSinOffset.X		= InitializeOffset( Inst.SourceShake->RotOscillation.Pitch );
		Inst.RotSinOffset.Y		= InitializeOffset( Inst.SourceShake->RotOscillation.Yaw );
		Inst.RotSinOffset.Z		= InitializeOffset( Inst.SourceShake->RotOscillation.Roll );

		Inst.LocSinOffset.X		= InitializeOffset( Inst.SourceShake->LocOscillation.X );
		Inst.LocSinOffset.Y		= InitializeOffset( Inst.SourceShake->LocOscillation.Y );
		Inst.LocSinOffset.Z		= InitializeOffset( Inst.SourceShake->LocOscillation.Z );

		Inst.FOVSinOffset		= InitializeOffset( Inst.SourceShake->FOVOscillation );

		Inst.OscillatorTimeRemaining = Inst.SourceShake->OscillationDuration;

		if (Inst.SourceShake->OscillationBlendInTime > 0.f)
		{
			Inst.bBlendingIn = true;
			Inst.CurrentBlendInTime = 0.f;
		}
	}

	// init anims
	if (Inst.SourceShake->Anim != NULL)
	{
		bool bLoop = false;
		bool bRandomStart = false;
		float Duration = 0.f;
		if (Inst.SourceShake->bRandomAnimSegment)
		{
			bLoop = true;
			bRandomStart = true;
			Duration = Inst.SourceShake->RandomAnimSegmentDuration;
		}

		if (Scale > 0.f)
		{
			Inst.AnimInst = CameraOwner->PlayCameraAnim(Inst.SourceShake->Anim, Inst.SourceShake->AnimPlayRate, Scale, Inst.SourceShake->AnimBlendInTime, Inst.SourceShake->AnimBlendOutTime, bLoop, bRandomStart, Duration, Inst.SourceShake->bSingleInstance);
			if (PlaySpace != CAPS_CameraLocal && Inst.AnimInst != NULL)
			{
				Inst.AnimInst->SetPlaySpace(PlaySpace, UserPlaySpaceRot);
			}
		}
	}

	Inst.PlaySpace = PlaySpace;
	if (Inst.PlaySpace == CAPS_UserDefined)
	{
		Inst.UserPlaySpaceMatrix = FRotationMatrix(UserPlaySpaceRot);
	}

	return Inst;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:67,代码来源:CameraModifier_CameraShake.cpp

示例5: UnclaimTaskResource

void AAIController::UnclaimTaskResource(TSubclassOf<UGameplayTaskResource> ResourceClass)
{
    if (CachedGameplayTasksComponent)
    {
        const uint8 ResourceID = UGameplayTaskResource::GetResourceID(ResourceClass);
        if (ScriptClaimedResources.HasID(ResourceID) == true)
        {
            ScriptClaimedResources.RemoveID(ResourceID);

            UE_VLOG(this, LogGameplayTasks, Log, TEXT("UnclaimTaskResource %s"), *GetNameSafe(*ResourceClass));

            UGameplayTask* ResourceTask = CachedGameplayTasksComponent->FindResourceConsumingTaskByName(ResourceClass->GetFName());
            if (ResourceTask)
            {
                ResourceTask->EndTask();
            }
            UE_CVLOG(ResourceTask == nullptr, this, LogGameplayTasks, Warning, TEXT("UnclaimTaskResource failed to find UGameplayTask_ClaimResource instance"));
        }
    }
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:20,代码来源:AIController.cpp

示例6: ClaimTaskResource

void AAIController::ClaimTaskResource(TSubclassOf<UGameplayTaskResource> ResourceClass)
{
    if (CachedGameplayTasksComponent)
    {
        const uint8 ResourceID = UGameplayTaskResource::GetResourceID(ResourceClass);
        if (ScriptClaimedResources.HasID(ResourceID) == false)
        {
            ScriptClaimedResources.AddID(ResourceID);

            UE_VLOG(this, LogGameplayTasks, Log, TEXT("ClaimTaskResource %s"), *GetNameSafe(*ResourceClass));

            IGameplayTaskOwnerInterface& AsTaskOwner = *this;
            UGameplayTask_ClaimResource* ResourceTask = UGameplayTask_ClaimResource::ClaimResource(AsTaskOwner, ResourceClass, uint8(EAITaskPriority::High), ResourceClass->GetFName());
            if (ResourceTask)
            {
                CachedGameplayTasksComponent->AddTaskReadyForActivation(*ResourceTask);
            }
            UE_CVLOG(ResourceTask == nullptr, this, LogGameplayTasks, Warning, TEXT("ClaimTaskResource failed to create UGameplayTask_ClaimResource instance"));
        }
    }
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:21,代码来源:AIController.cpp


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