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


C++ USkeletalMeshComponent::AttachTo方法代码示例

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


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

示例1: AttachMeshToPawn

void AShooterWeapon::AttachMeshToPawn()
{
	if (MyPawn)
	{
		// Remove and hide both first and third person meshes
		DetachMeshFromPawn();

		// For locally controller players we attach both weapons and let the bOnlyOwnerSee, bOwnerNoSee flags deal with visibility.
		FName AttachPoint = MyPawn->GetWeaponAttachPoint();
		if( MyPawn->IsLocallyControlled() == true )
		{
			USkeletalMeshComponent* PawnMesh1p = MyPawn->GetSpecifcPawnMesh(true);
			USkeletalMeshComponent* PawnMesh3p = MyPawn->GetSpecifcPawnMesh(false);
			Mesh1P->SetHiddenInGame( false );
			Mesh3P->SetHiddenInGame( false );
			Mesh1P->AttachTo(PawnMesh1p, AttachPoint);
			Mesh3P->AttachTo(PawnMesh3p, AttachPoint);
		}
		else
		{
			USkeletalMeshComponent* UseWeaponMesh = GetWeaponMesh();
			USkeletalMeshComponent* UsePawnMesh = MyPawn->GetPawnMesh();
			UseWeaponMesh->AttachTo(UsePawnMesh, AttachPoint);	
			UseWeaponMesh->SetHiddenInGame( false );
		}
	}
}
开发者ID:t-p-tan,项目名称:CS4350-Die-Another-Day,代码行数:27,代码来源:ShooterWeapon.cpp

示例2: AttachWeapon

//void AARWeapon::OnRep_WeaponOwner()
//{
//	if (WeaponOwner)
//		SetWeaponOwner(WeaponOwner);
//}
//void AARWeapon::SetWeaponOwner(AARCharacter* NewOwner)
//{
//	WeaponOwner = NewOwner;
//	SetOwner(NewOwner);
//}
void AARWeapon::AttachWeapon()
{
	if (ARCharacterOwner)
	{
		// Remove and hide both first and third person meshes

		// For locally controller players we attach both weapons and let the bOnlyOwnerSee, bOwnerNoSee flags deal with visibility.
		//FName AttachPoint = WeaponOwner->GetWeaponAttachPoint();
		if (ARCharacterOwner->IsLocallyControlled() == true)
		{
			USkeletalMeshComponent* PawnMesh3p = ARCharacterOwner->GetMesh();
			WeaponMesh->SetHiddenInGame(false);
			WeaponMesh->AttachTo(PawnMesh3p, "TestSocket");
		}
		else
		{
			USkeletalMeshComponent* UseWeaponMesh = WeaponMesh;
			USkeletalMeshComponent* UsePawnMesh = ARCharacterOwner->GetMesh();
			UseWeaponMesh->AttachTo(UsePawnMesh, "TestSocket");
			UseWeaponMesh->SetHiddenInGame(false);
		}
	}
}
开发者ID:ChuckKanuck,项目名称:ActionRPGGame,代码行数:33,代码来源:ARWeapon.cpp


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