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