• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ UAnimInstance类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetActiveWeight

bool SAnimCurveListRow::GetActiveWeight(float& OutWeight) const
{
	bool bFoundActive = false;

	// If anim viewer
	TSharedPtr<SAnimCurveViewer> AnimCurveViewer = AnimCurveViewerPtr.Pin();
	if (AnimCurveViewer.IsValid())
	{
		// If anim instance
		UAnimInstance* AnimInstance = PreviewScenePtr.Pin()->GetPreviewMeshComponent()->GetAnimInstance();
		if (AnimInstance)
		{
			// See if curve is in active set, attribute curve should have everything
			TMap<FName, float> CurveList;
			AnimInstance->GetAnimationCurveList(EAnimCurveType::AttributeCurve, CurveList);

			float* CurrentValue = CurveList.Find(Item->SmartName.DisplayName);
			if (CurrentValue)
			{
				OutWeight = *CurrentValue;
				// Remember we found it
				bFoundActive = true;
			}
		}
	}

	return bFoundActive;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:28,代码来源:SAnimCurveViewer.cpp


示例2: SetIsRunning

void AMurphysLawCharacter::Fire()
{
	// check if we have a weapon equipped
	if (HasWeaponEquipped())
	{
		// if the weapon has been able to fire
		if (GetEquippedWeapon()->Fire(this))
		{
			// Stop the character from running
			SetIsRunning(false);

			// try and play a firing animation if specified
			if (FireAnimation != nullptr)
			{
				// Get the animation object for the arms mesh
				UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
				if (AnimInstance != nullptr)
				{
					AnimInstance->Montage_Play(FireAnimation, 1.f);
				}
			}

			// check for bullet collisions
			ComputeBulletCollisions();
		}

		// We reload the weapon if it is empty and we have bullets left in our inventory
		if (ShouldReload())
		{
			Reload();
		}
	}
}
开发者ID:grondinjc,项目名称:murphyslaw,代码行数:33,代码来源:MurphysLawCharacter.cpp


示例3: GetControlRotation

void AMobileOpenCVCharacter::OnFire()
{ 
	// try and fire a projectile
	if (ProjectileClass != NULL)
	{
		const FRotator SpawnRotation = GetControlRotation();
		// MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position
		const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset);

		UWorld* const World = GetWorld();
		if (World != NULL)
		{
			// spawn the projectile at the muzzle
			World->SpawnActor<AMobileOpenCVProjectile>(ProjectileClass, SpawnLocation, SpawnRotation);
		}
	}

	// try and play the sound if specified
	if (FireSound != NULL)
	{
		UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
	}

	// try and play a firing animation if specified
	if(FireAnimation != NULL)
	{
		// Get the animation object for the arms mesh
		UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
		if(AnimInstance != NULL)
		{
			AnimInstance->Montage_Play(FireAnimation, 1.f);
		}
	}

}
开发者ID:brucelane,项目名称:UEMobileOpenCV,代码行数:35,代码来源:MobileOpenCVCharacter.cpp


示例4: PreviewSetAnimPosition

void FMovieSceneSkeletalAnimationTrackInstance::PreviewSetAnimPosition(USkeletalMeshComponent* SkeletalMeshComponent, FName SlotName, int32 ChannelIndex, UAnimSequenceBase* InAnimSequence, float InPosition, bool bLooping, bool bFireNotifies, float DeltaTime, bool bPlaying, bool bResetDynamics)
{
	if(CanPlayAnimation(SkeletalMeshComponent, InAnimSequence))
	{
		UAnimMontage* Montage = FAnimMontageInstance::PreviewMatineeSetAnimPositionInner(SlotName, SkeletalMeshComponent, InAnimSequence, InPosition, bLooping, bFireNotifies, DeltaTime);

		// if we are not playing, make sure we dont continue (as skeletal meshes can still tick us onwards)
		UAnimInstance* AnimInst = SkeletalMeshComponent->GetAnimInstance();
		UAnimSingleNodeInstance * SingleNodeInst = SkeletalMeshComponent->GetSingleNodeInstance();
		if(SingleNodeInst)
		{
			SingleNodeInst->SetPlaying(bPlaying);
		}
		else if (AnimInst)
		{
			if(Montage)
			{
				if(bPlaying)
				{
					AnimInst->Montage_Resume(Montage);
				}
				else
				{
					AnimInst->Montage_Pause(Montage);
				}
			}

			if(bResetDynamics)
			{
				// make sure we reset any simulations
				AnimInst->ResetDynamics();
			}
		}
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:35,代码来源:MovieSceneSkeletalAnimationTrackInstance.cpp


示例5:

class UAnimMontage * ACharacter::GetCurrentMontage()
{
    UAnimInstance * AnimInstance = (Mesh)? Mesh->GetAnimInstance() : NULL;
    if ( AnimInstance )
    {
        return AnimInstance->GetCurrentActiveMontage();
    }

    return NULL;
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:10,代码来源:Character.cpp


示例6: StopAnimMontage

void ACharacter::StopAnimMontage(class UAnimMontage* AnimMontage)
{
    UAnimInstance * AnimInstance = (Mesh)? Mesh->GetAnimInstance() : NULL;
    UAnimMontage * MontageToStop = (AnimMontage)? AnimMontage : GetCurrentMontage();
    bool bShouldStopMontage =  AnimInstance && MontageToStop && !AnimInstance->Montage_GetIsStopped(MontageToStop);

    if ( bShouldStopMontage )
    {
        AnimInstance->Montage_Stop(MontageToStop->BlendOutTime, MontageToStop);
    }
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:11,代码来源:Character.cpp


示例7: GetActorLocation

void AFP_FirstPersonCharacter::OnFire()
{
	// Play a sound if there is one
	if (FireSound != NULL)
	{
		UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
	}

	// try and play a firing animation if specified
	if(FireAnimation != NULL)
	{
		// Get the animation object for the arms mesh
		UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
		if(AnimInstance != NULL)
		{
			AnimInstance->Montage_Play(FireAnimation, 1.f);
		}
	}

	// Now send a trace from the end of our gun to see if we should hit anything
	APlayerController* PlayerController = Cast<APlayerController>(GetController());
	
	// Calculate the direction of fire and the start location for trace
	FVector CamLoc;
	FRotator CamRot;
	PlayerController->GetPlayerViewPoint(CamLoc, CamRot);
	const FVector ShootDir = CamRot.Vector();

	FVector StartTrace = FVector::ZeroVector;
	if (PlayerController)
	{
		FRotator UnusedRot;
		PlayerController->GetPlayerViewPoint(StartTrace, UnusedRot);

		// Adjust trace so there is nothing blocking the ray between the camera and the pawn, and calculate distance from adjusted start
		StartTrace = StartTrace + ShootDir * ((GetActorLocation() - StartTrace) | ShootDir);
	}

	// Calculate endpoint of trace
	const FVector EndTrace = StartTrace + ShootDir * WeaponRange;

	// Check for impact
	const FHitResult Impact = WeaponTrace(StartTrace, EndTrace);

	// Deal with impact
	AActor* DamagedActor = Impact.GetActor();
	UPrimitiveComponent* DamagedComponent = Impact.GetComponent();

	// If we hit an actor, with a component that is simulating physics, apply an impulse
	if ((DamagedActor != NULL) && (DamagedActor != this) && (DamagedComponent != NULL) && DamagedComponent->IsSimulatingPhysics())
	{
		DamagedComponent->AddImpulseAtLocation(ShootDir*WeaponDamage, Impact.Location);
	}
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:54,代码来源:FP_FirstPersonCharacter.cpp


示例8: SetAnimBlueprint

bool FAnimBlueprintThumbnailScene::SetAnimBlueprint(class UAnimBlueprint* InBlueprint)
{
    PreviewActor->GetSkeletalMeshComponent()->OverrideMaterials.Empty();

    bool bSetSucessfully = false;

    PreviewBlueprint = InBlueprint;

    if (InBlueprint)
    {
        if (USkeleton* Skeleton = InBlueprint->TargetSkeleton)
        {
            USkeletalMesh* PreviewSkeletalMesh = Skeleton->GetPreviewMesh(true);

            PreviewActor->GetSkeletalMeshComponent()->SetSkeletalMesh(PreviewSkeletalMesh);

            if (PreviewSkeletalMesh)
            {
                bSetSucessfully = true;

                UAnimInstance* PreviousInstance = PreviewActor->GetSkeletalMeshComponent()->GetAnimInstance();

                PreviewActor->GetSkeletalMeshComponent()->SetAnimInstanceClass(InBlueprint->GeneratedClass);

                if (PreviousInstance && PreviousInstance != PreviewActor->GetSkeletalMeshComponent()->GetAnimInstance())
                {
                    //Mark this as gone!
                    PreviousInstance->MarkPendingKill();
                }

                FTransform MeshTransform = FTransform::Identity;

                PreviewActor->SetActorLocation(FVector(0, 0, 0), false);
                PreviewActor->GetSkeletalMeshComponent()->UpdateBounds();

                // Center the mesh at the world origin then offset to put it on top of the plane
                const float BoundsZOffset = GetBoundsZOffset(PreviewActor->GetSkeletalMeshComponent()->Bounds);
                PreviewActor->SetActorLocation(-PreviewActor->GetSkeletalMeshComponent()->Bounds.Origin + FVector(0, 0, BoundsZOffset), false);
                PreviewActor->GetSkeletalMeshComponent()->RecreateRenderState_Concurrent();
            }
        }
    }

    if (!bSetSucessfully)
    {
        CleanupComponentChildren(PreviewActor->GetSkeletalMeshComponent());
        PreviewActor->GetSkeletalMeshComponent()->SetSkeletalMesh(nullptr);
        PreviewActor->GetSkeletalMeshComponent()->SetAnimInstanceClass(nullptr);
    }

    return bSetSucessfully;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:52,代码来源:ThumbnailHelpers.cpp


示例9: GetActorLocation

void AShaderPluginDemoCharacter::OnFire()
{
	//Try to set a texture to the object we hit!
	FHitResult HitResult;
	FVector StartLocation = FirstPersonCameraComponent->GetComponentLocation();
	FRotator Direction = FirstPersonCameraComponent->GetComponentRotation();
	FVector EndLocation = StartLocation + Direction.Vector() * 10000;
	FCollisionQueryParams QueryParams;
	QueryParams.AddIgnoredActor(this);

	if (GetWorld()->LineTraceSingleByChannel(HitResult, StartLocation, EndLocation, ECC_Visibility, QueryParams))
	{
		TArray<UStaticMeshComponent*> StaticMeshComponents = TArray<UStaticMeshComponent*>();
		AActor* HitActor = HitResult.GetActor();

		if (NULL != HitActor)
		{
			HitActor->GetComponents<UStaticMeshComponent>(StaticMeshComponents);
			for (int32 i = 0; i < StaticMeshComponents.Num(); i++)
			{
				UStaticMeshComponent* CurrentStaticMeshPtr = StaticMeshComponents[i];
				CurrentStaticMeshPtr->SetMaterial(0, MaterialToApplyToClickedObject);
				UMaterialInstanceDynamic* MID = CurrentStaticMeshPtr->CreateAndSetMaterialInstanceDynamic(0);
				UTexture* CastedRenderTarget = Cast<UTexture>(RenderTarget);
				MID->SetTextureParameterValue("InputTexture", CastedRenderTarget);
			}
		}
	}

	// try and play the sound if specified
	if (FireSound != NULL)
	{
		UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
	}

	// try and play a firing animation if specified
	if (FireAnimation != NULL)
	{
		// Get the animation object for the arms mesh
		UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
		if (AnimInstance != NULL)
		{
			AnimInstance->Montage_Play(FireAnimation, 1.f);
		}
	}
}
开发者ID:alexgr,项目名称:UE4ShaderPluginDemo,代码行数:46,代码来源:ShaderPluginDemoCharacter.cpp


示例10: OnReloadBegin

void AGWWeaponRanged::OnRep_ReloadBeign()
{
	OnReloadBegin();
	if (ReloadAnimation)
	{
		IIGISkeletalMesh* skelMeshInt = Cast<IIGISkeletalMesh>(Instigator);
		if (!skelMeshInt)
			return;

		UAnimInstance* AnimInst = skelMeshInt->GetMasterSkeletalMesh()->GetAnimInstance();
		if (!AnimInst)
			return;
		float montageLenght = ReloadAnimation->CalculateSequenceLength();

		float multiplier = montageLenght / ReloadTime;

		AnimInst->Montage_Play(ReloadAnimation, multiplier);
	}
}
开发者ID:HaoDrang,项目名称:ActionRPGGame,代码行数:19,代码来源:GWWeaponRanged.cpp


示例11: FinishAnimControl

void FMovieSceneSkeletalAnimationTrackInstance::FinishAnimControl(USkeletalMeshComponent* SkeletalMeshComponent)
{
	if(SkeletalMeshComponent->GetAnimationMode() == EAnimationMode::Type::AnimationBlueprint)
	{
		UAnimInstance* AnimInstance = SkeletalMeshComponent->GetAnimInstance();
		if(AnimInstance)
		{
			AnimInstance->Montage_Stop(0.f);
			AnimInstance->UpdateAnimation(0.f, false);
		}

		// Update space bases to reset it back to ref pose
		SkeletalMeshComponent->RefreshBoneTransforms();
		SkeletalMeshComponent->RefreshSlaveComponents();
		SkeletalMeshComponent->UpdateComponentToWorld();
	}

	CurrentlyPlayingMontage = nullptr;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:19,代码来源:MovieSceneSkeletalAnimationTrackInstance.cpp


示例12: SetAnimPosition

void FMovieSceneSkeletalAnimationTrackInstance::SetAnimPosition(USkeletalMeshComponent* SkeletalMeshComponent, FName SlotName, int32 ChannelIndex, UAnimSequenceBase* InAnimSequence, float InPosition, bool bLooping, bool bFireNotifies)
{
	if (CanPlayAnimation(SkeletalMeshComponent, InAnimSequence))
	{
		UAnimMontage* Montage = FAnimMontageInstance::SetMatineeAnimPositionInner(SlotName, SkeletalMeshComponent, InAnimSequence, InPosition, bLooping);

		// Ensure the sequence is not stopped
		UAnimInstance* AnimInst = SkeletalMeshComponent->GetAnimInstance();
		UAnimSingleNodeInstance* SingleNodeInst = SkeletalMeshComponent->GetSingleNodeInstance();
		if(SingleNodeInst)
		{
			SingleNodeInst->SetPlaying(true);
		}
		else if (AnimInst && Montage)
		{
			AnimInst->Montage_Resume(Montage);
		}
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:19,代码来源:MovieSceneSkeletalAnimationTrackInstance.cpp


示例13: GetControlRotation

void ATotemCharacter::OnFire()
{
	//only server can spawn projectile theoretically
	// try and fire a projectile
	if (ProjectileClass != NULL || FireProjectileClass != NULL)
	{
		const FRotator SpawnRotation = GetControlRotation();
		// MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position
		const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset);

		UWorld* const World = GetWorld();
		if (World != NULL)
		{
			//to add owner and instigator information
			FActorSpawnParameters SpawnParams;
			SpawnParams.Owner = Cast<ATotemPlayerController>(Controller);
			SpawnParams.Instigator = Instigator;
			//When the server function is called by serve, it also execute. 
			ServerSpawnProjectile(SpawnLocation, SpawnRotation, SpawnParams.Owner, SpawnParams.Instigator);
			// spawn the projectile at the muzzle single player version
			//World->SpawnActor<ATotemProjectile>(ProjectileClass, SpawnLocation, SpawnRotation, SpawnParams);
		}
	}


	// try and play the sound if specified
	if (FireSound != NULL)
	{
		UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
	}

	// try and play a firing animation if specified
	if (FireAnimation != NULL)
	{
		// Get the animation object for the arms mesh
		UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
		if (AnimInstance != NULL)
		{
			AnimInstance->Montage_Play(FireAnimation, 1.f);
		}
	}

}
开发者ID:whiteeat,项目名称:TotemCodeSample,代码行数:43,代码来源:TotemCharacter.cpp


示例14: GetControlRotation

void AUDKPresentationCharacter::OnFire()
{ 
	if (CharacterMovement->IsMovingOnGround()) {
		ammo = maxAmmo;
	}
	if (ammo <= 0) return;
	// try and fire a projectile
	if (ProjectileClass != NULL)
	{
		const FRotator SpawnRotation = GetControlRotation();
		// MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position
		const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset);

		ammo--;
		CharacterMovement->Velocity = GetControlRotation().Vector()*(-1000) + 0.5f * CharacterMovement->Velocity;

		UWorld* const World = GetWorld();
		if (World != NULL)
		{
			// spawn the projectile at the muzzle
			World->SpawnActor<AUDKPresentationProjectile>(ProjectileClass, SpawnLocation, SpawnRotation);
		}
	}

	// try and play the sound if specified
	if (FireSound != NULL)
	{
		UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
	}

	// try and play a firing animation if specified
	if(FireAnimation != NULL)
	{
		// Get the animation object for the arms mesh
		UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
		if(AnimInstance != NULL)
		{
			AnimInstance->Montage_Play(FireAnimation, 1.f);
		}
	}

}
开发者ID:IronPeak,项目名称:UDKPresentation,代码行数:42,代码来源:UDKPresentationCharacter.cpp


示例15: TickTask

void UBTTask_ShowPhrases::TickTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
	Super::TickTask(OwnerComp, NodeMemory, DeltaSeconds);
	bool bCharacterAnimationFinished = true;

	if (DialogueCharacterAnimationOptions.bPlayAnimation)
	{
		CharacterAnimationDuration -= DeltaSeconds;
		if (CharacterAnimationDuration <=0.0f && DialogueCharacterAnimationOptions.bLoop && !bTextFinished)
		{
			UAnimInstance *AnimInst = Mesh->GetAnimInstance();
			if (AnimInst)
			{
				AnimInst->PlaySlotAnimationAsDynamicMontage(DialogueCharacterAnimationOptions.Animation,
					DialogueCharacterAnimationOptions.AnimationBlendOptions.SlotNodeName,
					DialogueCharacterAnimationOptions.AnimationBlendOptions.BlendInTime,
					DialogueCharacterAnimationOptions.AnimationBlendOptions.BlendOutTime,
					DialogueCharacterAnimationOptions.AnimationBlendOptions.InPlayRate);
			}
			UAnimSequenceBase* SequenceBase = DialogueCharacterAnimationOptions.Animation;
			CharacterAnimationDuration = SequenceBase->SequenceLength / SequenceBase->RateScale;
		}
		bCharacterAnimationFinished = (CharacterAnimationDuration <= 0.0f && bCharacterAnimationStarted) || (!DialogueCharacterAnimationOptions.bWaitEndOfAnimation && bTextFinished) ? true : false;
	}
	if (bTextFinished && bCharacterAnimationFinished)
	{
		bCharacterAnimationFinished = false;
		bTextFinished = false;
		ShowingNumPhrase = 0;
		UWidgetTree* WidgetTree = Widget->WidgetTree;
		UWidget* DialogueEventListener = WidgetTree->FindWidget(FName("DialogueEventListener"));
		if (DialogueEventListener != nullptr)
		{
			UDialogueEventListener* EventListener = Cast<UDialogueEventListener>(DialogueEventListener);
			if (EventListener)
			{
				EventListener->ShowPhrasesNode = nullptr;
			}
		}
		FinishLatentTask(OwnerComp, EBTNodeResult::Succeeded);
	}
}
开发者ID:thejohncrafter,项目名称:UE4-DialogueSystem,代码行数:42,代码来源:BTTask_ShowPhrases.cpp


示例16: OnEquip

void AGun::OnEquip()
{
	Super::OnEquip();

	if (WeaponEquipAnimation)
	{
		Mesh->GetAnimInstance()->Montage_Play(WeaponEquipAnimation, 1.f);
	}

	if (PlayerEquipAnimation)
	{
		UAnimInstance* AnimInstance = Cast<AFPSCodeCharacter>(UGameplayStatics::GetPlayerCharacter(this, 0))->GetMesh1P()->GetAnimInstance();

		if (AnimInstance)
		{
			AnimInstance->Montage_Play(PlayerEquipAnimation, 1.f);
		}
	}

}
开发者ID:adamhynek,项目名称:Unreal-Engine-FPS,代码行数:20,代码来源:Gun.cpp


示例17: Reload

void AGun::Reload()
{
	if (!IsReloading)
	{
		if (CurrentAmmo < MagSize && TotalAmmo > 0)
		{
			IsReloading = true;

			//Playing Reload animation on weapon
			if (WeaponReloadAnimation)
			{
				Mesh->GetAnimInstance()->Montage_Play(WeaponReloadAnimation, 1.f);
			}

			//Playing Reload animation montage on player
			if (PlayerReloadAnimation)
			{
				UAnimInstance* AnimInstance = Cast<AFPSCodeCharacter>(UGameplayStatics::GetPlayerCharacter(this, 0))->GetMesh1P()->GetAnimInstance();

				if (AnimInstance)
				{
					bCanAttack = false;

					float AnimTime = AnimInstance->Montage_Play(PlayerReloadAnimation, 1.f);

					FTimerHandle AnimHandle;
                      
					GetWorld()->GetTimerManager().SetTimer(AnimHandle, this, &AGun::SetAmmoValues, AnimTime);      //Set timer to apply reloaded ammo values when animation is done
				}
				else
				{
					SetAmmoValues();
				}
			}
			else
			{
				SetAmmoValues();
			}
		}
	}
}
开发者ID:adamhynek,项目名称:Unreal-Engine-FPS,代码行数:41,代码来源:Gun.cpp


示例18: PlayAnimMontage

float ACharacter::PlayAnimMontage(class UAnimMontage* AnimMontage, float InPlayRate, FName StartSectionName)
{
    UAnimInstance * AnimInstance = (Mesh)? Mesh->GetAnimInstance() : NULL;
    if( AnimMontage && AnimInstance )
    {
        float const Duration = AnimInstance->Montage_Play(AnimMontage, InPlayRate);

        if (Duration > 0.f)
        {
            // Start at a given Section.
            if( StartSectionName != NAME_None )
            {
                AnimInstance->Montage_JumpToSection(StartSectionName, AnimMontage);
            }

            return Duration;
        }
    }

    return 0.f;
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:21,代码来源:Character.cpp


示例19: GetActorLocation

void ABETCharacter::OnFire()
{ 
	if (Weapon){
		Weapon->Fire();
	}

	// try and play the sound if specified
	if (Weapon->FireSound != NULL)
	{
		UGameplayStatics::PlaySoundAtLocation(this, Weapon->FireSound, GetActorLocation());
	}

	// try and play a firing animation if specified
	if (Weapon->FireAnimation != NULL)
	{
		// Get the animation object for the arms mesh
		UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance();
		if (AnimInstance != NULL)
		{
			AnimInstance->Montage_Play(Weapon->FireAnimation, 1.f);
		}
	}
}
开发者ID:brandon2499,项目名称:14BirdsEyeTerrace,代码行数:23,代码来源:BETCharacter.cpp


示例20: PreviewFinishAnimControl

void FMovieSceneSkeletalAnimationTrackInstance::PreviewFinishAnimControl(USkeletalMeshComponent* SkeletalMeshComponent)
{
	if (CanPlayAnimation(SkeletalMeshComponent))
	{
		// if in editor, reset the Animations, makes easier for artist to see them visually and align them
		// in game, we keep the last pose that matinee kept. If you'd like it to have animation, you'll need to have AnimTree or AnimGraph to handle correctly
		if (SkeletalMeshComponent->GetAnimationMode() == EAnimationMode::Type::AnimationBlueprint)
		{
			UAnimInstance* AnimInstance = SkeletalMeshComponent->GetAnimInstance();
			if(AnimInstance)
			{
				AnimInstance->Montage_Stop(0.f);
				AnimInstance->UpdateAnimation(0.f, false);
			}
		}
		// Update space bases to reset it back to ref pose
		SkeletalMeshComponent->RefreshBoneTransforms();
		SkeletalMeshComponent->RefreshSlaveComponents();
		SkeletalMeshComponent->UpdateComponentToWorld();
	}

	CurrentlyPlayingMontage = nullptr;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:23,代码来源:MovieSceneSkeletalAnimationTrackInstance.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ UAnimationAsset类代码示例发布时间:2022-05-31
下一篇:
C++ UActorComponent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap