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


C++ FAnimMontageInstance::GetCurrentSection方法代码示例

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


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

示例1: Montage_GetCurrentSection

FName UAnimInstance::Montage_GetCurrentSection()
{
	FAnimMontageInstance * CurMontageInstance = GetActiveMontageInstance();
	if ( CurMontageInstance )
	{
		return CurMontageInstance->GetCurrentSection();
	}

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

示例2: DisplayDebug


//.........这里部分代码省略.........
			CharacterMovement->DisplayDebug(Canvas, DebugDisplay, YL, YPos);
		}
		const bool Crouched = CharacterMovement && CharacterMovement->IsCrouching();
		FString T = FString::Printf(TEXT("Crouched %i"), Crouched);
		Canvas->DrawText(RenderFont, T, Indent, YPos );
		YPos += YL;
	}

	if(Mesh && Mesh->GetAnimInstance())
	{
		static FName NAME_Animation = FName(TEXT("Animation"));
		if( DebugDisplay.Contains(NAME_Animation) )
		{
			YPos += YL;

			Canvas->DrawText(RenderFont, TEXT("Animation"), Indent, YPos );
			YPos += YL;
			Indenter AnimIndent(Indent);

			//Display Sync Groups
			UAnimInstance* AnimInstance = Mesh->GetAnimInstance();
			
			FString Heading = FString::Printf(TEXT("SyncGroups: %i"), AnimInstance->SyncGroups.Num());
			Canvas->DrawText(RenderFont, Heading, Indent, YPos );
			YPos += YL;

			for (int32 GroupIndex = 0; GroupIndex < AnimInstance->SyncGroups.Num(); ++GroupIndex)
			{
				Indenter GroupIndent(Indent);
				FAnimGroupInstance& SyncGroup = AnimInstance->SyncGroups[GroupIndex];

				FString GroupLabel = FString::Printf(TEXT("Group %i - Players %i"), GroupIndex, SyncGroup.ActivePlayers.Num());
				Canvas->DrawText(RenderFont, GroupLabel, Indent, YPos );
				YPos += YL;

				if (SyncGroup.ActivePlayers.Num() > 0)
				{
					const int32 GroupLeaderIndex = FMath::Max(SyncGroup.GroupLeaderIndex, 0);

					for(int32 PlayerIndex = 0; PlayerIndex < SyncGroup.ActivePlayers.Num(); ++PlayerIndex)
					{
						Indenter PlayerIndent(Indent);
						FAnimTickRecord& Player = SyncGroup.ActivePlayers[PlayerIndex];

						Canvas->SetLinearDrawColor( (PlayerIndex == GroupLeaderIndex) ? FLinearColor::Green : FLinearColor::Yellow);

						FString PlayerEntry = FString::Printf(TEXT("%i) %s W:%.3f"), PlayerIndex, *Player.SourceAsset->GetName(), Player.EffectiveBlendWeight);
						Canvas->DrawText(RenderFont, PlayerEntry, Indent, YPos );
						YPos += YL;
					}
				}
			}

			Heading = FString::Printf(TEXT("Ungrouped: %i"), AnimInstance->UngroupedActivePlayers.Num());
			Canvas->DrawText(RenderFont, Heading, Indent, YPos );
			YPos += YL;

			Canvas->SetLinearDrawColor( FLinearColor::Yellow );

			for (int32 PlayerIndex = 0; PlayerIndex < AnimInstance->UngroupedActivePlayers.Num(); ++PlayerIndex)
			{
				Indenter PlayerIndent(Indent);
				const FAnimTickRecord& Player = AnimInstance->UngroupedActivePlayers[PlayerIndex];
				FString PlayerEntry = FString::Printf(TEXT("%i) %s W:%.3f"), PlayerIndex, *Player.SourceAsset->GetName(), Player.EffectiveBlendWeight);
				Canvas->DrawText(RenderFont, PlayerEntry, Indent, YPos );
				YPos += YL;
			}

			Heading = FString::Printf(TEXT("Montages: %i"), AnimInstance->MontageInstances.Num());
			Canvas->DrawText(RenderFont, Heading, Indent, YPos );
			YPos += YL;

			for (int32 MontageIndex = 0; MontageIndex < AnimInstance->MontageInstances.Num(); ++MontageIndex)
			{
				Indenter PlayerIndent(Indent);

				Canvas->SetLinearDrawColor( (MontageIndex == (AnimInstance->MontageInstances.Num()-1)) ? FLinearColor::Green : FLinearColor::Yellow );

				FAnimMontageInstance* MontageInstance = AnimInstance->MontageInstances[MontageIndex];

				FString MontageEntry = FString::Printf(TEXT("%i) %s Sec: %s W:%.3f DW:%.3f"), MontageIndex, *MontageInstance->Montage->GetName(), *MontageInstance->GetCurrentSection().ToString(), MontageInstance->Weight, MontageInstance->DesiredWeight);
				Canvas->DrawText(RenderFont, MontageEntry, Indent, YPos );
				YPos += YL;
			}

		}

		static FName NAME_SimpleBones = FName(TEXT("SimpleBones"));
		static FName NAME_Bones = FName(TEXT("Bones"));

		if( DebugDisplay.Contains(NAME_SimpleBones) )
		{
			Mesh->DebugDrawBones(Canvas,true);
		}
		else if( DebugDisplay.Contains(NAME_Bones) )
		{
			Mesh->DebugDrawBones(Canvas,false);
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:101,代码来源:Character.cpp


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