本文整理汇总了C++中ACharacter::GetMesh方法的典型用法代码示例。如果您正苦于以下问题:C++ ACharacter::GetMesh方法的具体用法?C++ ACharacter::GetMesh怎么用?C++ ACharacter::GetMesh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACharacter
的用法示例。
在下文中一共展示了ACharacter::GetMesh方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChangeSize
void UCheatManager::ChangeSize( float F )
{
APawn* Pawn = GetOuterAPlayerController()->GetPawn();
// Note: only works on characters
ACharacter *Character = Cast<ACharacter>(Pawn);
if (Character)
{
ACharacter* DefaultCharacter = Character->GetClass()->GetDefaultObject<ACharacter>();
Character->GetCapsuleComponent()->SetCapsuleSize(DefaultCharacter->GetCapsuleComponent()->GetUnscaledCapsuleRadius() * F, DefaultCharacter->GetCapsuleComponent()->GetUnscaledCapsuleHalfHeight() * F);
if (Character->GetMesh())
{
Character->GetMesh()->SetRelativeScale3D(FVector(F));
}
Character->TeleportTo(Character->GetActorLocation(), Character->GetActorRotation());
}
}
示例2: HandleNewState
void ABatteryCollectorGameMode::HandleNewState(EBatteryPlayState NewState)
{
switch (NewState)
{
// If the game is playing
case EBatteryPlayState::EPlaying:
{
// spawn volumes active
for (ASpawnVolume* Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(true);
}
}
break;
// If we've won the game
case EBatteryPlayState::EWon:
{
// spawn volumes inactive
for (ASpawnVolume* Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(false);
}
}
break;
// If we've lost the game
case EBatteryPlayState::EGameOver:
{
// spawn volumes inactive
for (ASpawnVolume* Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(false);
}
// block player input
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
if (PlayerController)
{
PlayerController->SetCinematicMode(true, false, false, true, true);
}
// ragdoll the character
ACharacter* MyCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
if (MyCharacter)
{
MyCharacter->GetMesh()->SetSimulatePhysics(true);
MyCharacter->GetMovementComponent()->MovementState.bCanJump = false;
}
}
break;
// Unknown/default state
default:
case EBatteryPlayState::EUnknown:
{
// do nothing
}
break;
}
}
示例3: switch
void AAssignment_1GameMode::HandleCurrentState(EBatteryPlayState NewState)
{
switch (NewState)
{
// If the game is playing
case EBatteryPlayState::EPlaying:
{
// Spawn Volumes Active
for (ASpawnVolume * Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(true);
}
}
break;
// If we've won the game
case EBatteryPlayState::EWon:
{
// Spawn Volumes Inactive
for (ASpawnVolume * Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(false);
}
}
break;
// If we've lost the game
case EBatteryPlayState::EGameOver:
{
// Spawn Volumes Inactives
for (ASpawnVolume * Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(false);
}
// Block Player Input
APlayerController * PlayerController = UGameplayStatics::GetPlayerController(this, 0);
if (PlayerController)
{
PlayerController->SetCinematicMode(true, true, true);
}
// Ragdoll the character
ACharacter* MyCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
if (MyCharacter)
{
MyCharacter->GetMesh()->SetSimulatePhysics(true);
MyCharacter->GetMovementComponent()->MovementState.bCanJump = false;
}
}
break;
// Debug
default:
case EBatteryPlayState::EUnknown:
{
// Do nothing
}
break;
}
}
示例4: HandleNewState
void ABatteryCollectorGameMode::HandleNewState(EBatteryPlayState NewState)
{
switch (NewState)
{
case EBatteryPlayState::EPlaying:
{
for (ASpawnVolume* Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(true);
}
}
break;
case EBatteryPlayState::EGameOver:
{
for (ASpawnVolume* Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(false);
}
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
if (PlayerController)
{
PlayerController->SetCinematicMode(true, false, false, true, true);
}
ACharacter* MyCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
if (MyCharacter)
{
MyCharacter->GetMesh()->SetSimulatePhysics(true);
MyCharacter->GetMovementComponent()->MovementState.bCanJump = false;
}
}
break;
case EBatteryPlayState::EWon:
{
for (ASpawnVolume* Volume : SpawnVolumeActors)
{
Volume->SetSpawningActive(false);
}
}
break;
case EBatteryPlayState::EUnknown:
break;
default:
break;
}
}
示例5:
bool FMovieScene3DTransformSectionRecorderFactory::CanRecordObject(UObject* InObjectToRecord) const
{
if(USceneComponent* SceneComponent = Cast<USceneComponent>(InObjectToRecord))
{
// Dont record the root component transforms as this will be taken into account by the actor transform track
// Also dont record transforms of skeletal mesh components as they will be taken into account in the actor transform
bool bIsCharacterSkelMesh = false;
if (SceneComponent->IsA<USkeletalMeshComponent>() && SceneComponent->GetOwner()->IsA<ACharacter>())
{
ACharacter* Character = CastChecked<ACharacter>(SceneComponent->GetOwner());
bIsCharacterSkelMesh = SceneComponent == Character->GetMesh();
}
return (SceneComponent != SceneComponent->GetOwner()->GetRootComponent() && !bIsCharacterSkelMesh);
}
else
{
return InObjectToRecord->IsA<AActor>();
}
}
示例6: UpdateBeamTargetPoint
void ABatteryPickup::UpdateBeamTargetPoint()
{
ACharacter* Character = GetWorld()->GetFirstPlayerController()->GetCharacter();
FVector SocketLocation = Character->GetMesh()->GetSocketLocation("spine_02");
ParticleSystem->SetBeamTargetPoint(0, SocketLocation, 0);
}
示例7: HandleNewState
void ABatteryCollectorGameMode::HandleNewState(EBatteryPlayState NewState)
{
switch (NewState) {
case EBatteryPlayState::EPlaying :
// If the game is playing
//
// spawn volume active
for (ASpawnVolume* Volume : SpawnVolumeActors) {
Volume->SetSpawningActive(true);
}
break;
case EBatteryPlayState::EWon :
// if we won the game
//
// spawn volume inactive
for (ASpawnVolume* Volume : SpawnVolumeActors) {
Volume->SetSpawningActive(false);
}
break;
case EBatteryPlayState::EGameOver :
{
// If we lost
//
// spawn volume inactive
// block player input
// ragdoll the character
for (ASpawnVolume* Volume : SpawnVolumeActors) {
Volume->SetSpawningActive(false);
}
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
if(PlayerController)
{
PlayerController->SetCinematicMode(true, false, false, true, true);
UE_LOG(LogClass, Log, TEXT("You have set Cinematic Mode"));
}
else
{
UE_LOG(LogClass, Log, TEXT("Player Controller was invalid!!"));
}
// now ragdoll the character
ACharacter* MyCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
if(MyCharacter)
{
MyCharacter->GetMesh()->SetSimulatePhysics(true);
MyCharacter->GetMovementComponent()->MovementState.bCanJump=false;
UE_LOG(LogClass, Log, TEXT("ACharacter jump turned off and Set Simulate Physics on"));
}else
{
UE_LOG(LogClass, Log, TEXT("ACharacter was invalid!! (EGameOver State in HandleNewState"));
}
}
break;
default :
// unknown state - incase some code forgets to call
//
// use to help debug
break;
}
}