这篇教程C++ APlayerController类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中APlayerController类的典型用法代码示例。如果您正苦于以下问题:C++ APlayerController类的具体用法?C++ APlayerController怎么用?C++ APlayerController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了APlayerController类的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: checkvoid UDemoNetDriver::SpawnDemoRecSpectator( UNetConnection* Connection ){ check( Connection != NULL ); UClass* C = StaticLoadClass( AActor::StaticClass(), NULL, *DemoSpectatorClass, NULL, LOAD_None, NULL ); if ( C == NULL ) { UE_LOG( LogDemo, Error, TEXT( "UDemoNetDriver::SpawnDemoRecSpectator: Failed to load demo spectator class." ) ); return; } APlayerController* Controller = World->SpawnActor<APlayerController>( C ); if ( Controller == NULL ) { UE_LOG( LogDemo, Error, TEXT( "UDemoNetDriver::SpawnDemoRecSpectator: Failed to spawn demo spectator." ) ); return; } for ( FActorIterator It( World ); It; ++It) { if ( It->IsA( APlayerStart::StaticClass() ) ) { Controller->SetInitialLocationAndRotation( It->GetActorLocation(), It->GetActorRotation() ); break; } } Controller->SetReplicates( true ); Controller->SetAutonomousProxy( true ); Controller->SetPlayer( Connection );}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:34,
示例2: AddIdToMuteListvoid FPlayerMuteList::ServerMutePlayer(APlayerController* OwningPC, const FUniqueNetIdRepl& MuteId){ UWorld* World = OwningPC->GetWorld(); const TSharedPtr<const FUniqueNetId>& PlayerIdToMute = MuteId.GetUniqueNetId(); // Don't reprocess if they are already muted AddIdToMuteList(VoiceMuteList, PlayerIdToMute); // Add them to the packet filter list if not already on it AddIdToMuteList(VoicePacketFilter, PlayerIdToMute); // Replicate mute state to client OwningPC->ClientMutePlayer(MuteId); // Find the muted player's player controller so it can be notified APlayerController* OtherPC = GetPlayerControllerFromNetId(World, *PlayerIdToMute); if (OtherPC != NULL) { // Update their packet filter list too OtherPC->MuteList.ClientMutePlayer(OtherPC, OwningPC->PlayerState->UniqueId); // Tell the other PC to mute this one OtherPC->ClientMutePlayer(OwningPC->PlayerState->UniqueId); }}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:26,
示例3: GetWorldvoid APickUpItem::Prox_Implementation(AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult){ // if the overlapped actor is NOT the player, // you simply should return if (Cast<AActor>(OtherActor) == nullptr) { return; } // Get a reference to the player avatar, to give him // the item AAvatar *avatar = Cast<AAvatar>(UGameplayStatics::GetPlayerPawn( GetWorld(), 0)); // Let the player pick up item // Notice use of keyword this! // That is how _this_ Pickup can refer to itself. avatar->Pickup(this); if (CoinSound != NULL) { UGameplayStatics::PlaySoundAtLocation(this, CoinSound, GetActorLocation()); } // Get a reference to the controller APlayerController* PController = GetWorld() ->GetFirstPlayerController(); // Get a reference to the HUD from the controller AMyHUD* hud = Cast<AMyHUD>(PController->GetHUD()); hud->addMessage(Message(Icon, FString("Picked up ") + FString(" ") + Name + FString(" ")+FString::FromInt(Quantity), 2.0f, FColor::Black, FColor::Black)); Destroy(); }
开发者ID:dschmidl,项目名称:GE_Project,代码行数:31,
示例4: int32void APawn::PreInitializeComponents(){ Super::PreInitializeComponents(); if (Instigator == nullptr) { Instigator = this; } if (AutoPossessPlayer != EAutoReceiveInput::Disabled && GetNetMode() != NM_Client ) { const int32 PlayerIndex = int32(AutoPossessPlayer.GetValue()) - 1; APlayerController* PC = UGameplayStatics::GetPlayerController(this, PlayerIndex); if (PC) { PC->Possess(this); } else { GetWorld()->PersistentLevel->RegisterActorForAutoReceiveInput(this, PlayerIndex); } } UpdateNavigationRelevance();}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:26,
示例5: Tick// Called every framevoid ACameraDirector::Tick( float DeltaTime ){ Super::Tick( DeltaTime ); const float TimeBetweenCameraChanges = 2.0f; const float SmoothBlendTime = 0.75f; TimeToNextCameraChange -= DeltaTime; if (TimeToNextCameraChange <= 0.0f) { TimeToNextCameraChange += TimeBetweenCameraChanges; // Find the actor that handles control for the local player. APlayerController* OurPlayerController = UGameplayStatics::GetPlayerController(this, 0); if (OurPlayerController) { if ((OurPlayerController->GetViewTarget() != CameraOne) && (CameraOne != nullptr)) { // Cut instantly to camera one. OurPlayerController->SetViewTarget(CameraOne); } else if ((OurPlayerController->GetViewTarget() != CameraTwo) && (CameraTwo != nullptr)) { // Blend smoothly to camera two. OurPlayerController->SetViewTargetWithBlend(CameraTwo, SmoothBlendTime); } } }}
开发者ID:chaomengnan,项目名称:UE4QuickStart,代码行数:29,
示例6: UE_LOG/** * Delegate fired when the joining process for an online session has completed * * @param SessionName the name of the session this callback is for * @param bWasSuccessful true if the async action completed without error, false if there was an error */void UOnlineSessionClient::OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result){ UE_LOG(LogOnline, Verbose, TEXT("OnJoinSessionComplete %s bSuccess: %d"), *SessionName.ToString(), static_cast<int32>(Result)); SessionInt->ClearOnJoinSessionCompleteDelegate(OnJoinSessionCompleteDelegate); if (Result == EOnJoinSessionCompleteResult::Success) { FString URL; if (SessionInt->GetResolvedConnectString(SessionName, URL)) { APlayerController* PC = GetPlayerController(); if (PC) { if (bIsFromInvite) { URL += TEXT("?bIsFromInvite"); bIsFromInvite = false; } PC->ClientTravel(URL, TRAVEL_Absolute); } } else { UE_LOG(LogOnline, Warning, TEXT("Failed to join session %s"), *SessionName.ToString()); } }}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:33,
示例7: PostSeamlessTravelvoid AGameModeBase::PostSeamlessTravel(){ if (GameSession) { GameSession->PostSeamlessTravel(); } // We have to make a copy of the controller list, since the code after this will destroy // and create new controllers in the world's list TArray<TAutoWeakObjectPtr<AController> > OldControllerList; for (auto It = GetWorld()->GetControllerIterator(); It; ++It) { OldControllerList.Add(*It); } // Handle players that are already loaded for (FConstControllerIterator Iterator = OldControllerList.CreateConstIterator(); Iterator; ++Iterator) { AController* Controller = *Iterator; if (Controller->PlayerState) { APlayerController* PlayerController = Cast<APlayerController>(Controller); if (!PlayerController || PlayerController->HasClientLoadedCurrentWorld()) { // Don't handle if player is still loading world, that gets called in ServerNotifyLoadedWorld HandleSeamlessTravelPlayer(Controller); } } }}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:30,
示例8: NSLOCTEXTvoid FPlatformerIngameMenu::ReturnToMainMenu(){ APlatformerPlayerController * PlatformPC = (PCOwner.IsValid())? Cast<APlatformerPlayerController>(PCOwner.Get()) : NULL; FString RemoteReturnReason = NSLOCTEXT("NetworkErrors", "HostHasLeft", "Host has left the game.").ToString(); FString LocalReturnReason(TEXT("")); if ( PlatformPC ) { if (PlatformPC->GetNetMode() < NM_Client) { for(auto Iterator = PlatformPC->GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator) { APlayerController* Controller = *Iterator; if (Controller && Controller->IsPrimaryPlayer() && Controller != PlatformPC) { Controller->ClientReturnToMainMenu(RemoteReturnReason); } } PlatformPC->ClientReturnToMainMenu(LocalReturnReason); } else { PlatformPC->ClientReturnToMainMenu(LocalReturnReason); } } DestroyRootMenu();}
开发者ID:jresch,项目名称:SpeechRecognitionGameControl,代码行数:28,
示例9: ReceivedSelectCameravoid ANetworkController::ReceivedSelectCamera(msgpack_object* Data) { FString name = Unpack<FString>(Data); APlayerController* PlayerController = NULL; for (auto Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator) { PlayerController = *Iterator; break; } if (!PlayerController) { return; } //PlayerController->PlayerCameraManager->PlayCameraAnim() for (TActorIterator<ACameraActor> ObjIt(GetWorld()); ObjIt; ++ObjIt) { ACameraActor* Camera = *ObjIt; //GEngine->AddOnScreenDebugMessage(-1, 60.f, FColor::Yellow, Camera->GetName()); if (Camera->GetName() == name) { PlayerController->SetViewTarget(Camera); AFollowRoadCamera* FollowRoadCamera = Cast<AFollowRoadCamera>(Camera); if (FollowRoadCamera) { FollowRoadCamera->Start(false, 0); } return; } }}
开发者ID:HighwayFlocking,项目名称:HighwayFlocking,代码行数:29,
示例10: TickComponentvoid UTDCSpectatorPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction){ Super::TickComponent(DeltaTime, TickType, ThisTickFunction); if (!PawnOwner || !UpdatedComponent) { return; } APlayerController* PlayerController = Cast<APlayerController>(PawnOwner->GetController()); if (PlayerController && PlayerController->IsLocalController()) { if (!bInitialLocationSet) { PawnOwner->SetActorRotation(PlayerController->GetControlRotation()); PawnOwner->SetActorLocation(PlayerController->GetSpawnLocation()); bInitialLocationSet = true; } FVector MyLocation = UpdatedComponent->GetComponentLocation(); ATDCSpectatorPawn* SpectatorPawn = Cast<ATDCSpectatorPawn>(PlayerController->GetSpectatorPawn()); if ((SpectatorPawn != NULL) && (SpectatorPawn->GetCameraComponent() != NULL)) { SpectatorPawn->GetCameraComponent()->ClampCameraLocation(PlayerController, MyLocation); } UpdatedComponent->SetWorldLocation(MyLocation, false); }}
开发者ID:ntk4,项目名称:UE4TopDownCamera,代码行数:28,
示例11: GetWorldvoid UNetGameInstance::OnCompleted(FName SessionName, EOnJoinSessionCompleteResult::Type Result){ APlayerController* PC = GetWorld()->GetFirstPlayerController(); FFrame::KismetExecutionMessage(TEXT("Yeeee Join succesful"), ELogVerbosity::Warning); auto Sessions = Online::GetSessionInterface(); if (Sessions.IsValid()) { Sessions->ClearOnJoinSessionCompleteDelegate(Delegate); if (Result == EOnJoinSessionCompleteResult::Success) { // Client travel to the server FString ConnectString; if (Sessions->GetResolvedConnectString(GameSessionName, ConnectString) && PC->IsValidLowLevel()) { //UE_LOG(Network, Log, TEXT("Join session: traveling to %s"), *ConnectString); PC->ClientTravel(ConnectString, TRAVEL_Absolute); return; } } } }
开发者ID:xzessmedia,项目名称:SteamFriendsUE4,代码行数:32,
示例12: ue_py_checkPyObject *py_ue_get_player_pawn(ue_PyUObject *self, PyObject * args){ ue_py_check(self); int controller_id = 0; if (!PyArg_ParseTuple(args, "|i:get_player_pawn", &controller_id)) { return NULL; } UWorld *world = ue_get_uworld(self); if (!world) return PyErr_Format(PyExc_Exception, "unable to retrieve UWorld from uobject"); APlayerController *controller = UGameplayStatics::GetPlayerController(world, controller_id); if (!controller) return PyErr_Format(PyExc_Exception, "unable to retrieve controller %d", controller_id); // the controller could not have a pawn if (!controller->GetPawn()) Py_RETURN_NONE; Py_RETURN_UOBJECT(controller->GetPawn());}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:25,
示例13: ProcessTransitionvoid ACameraDirector::ProcessTransition(){ APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0); if (PlayerController) { FCameraStruct CameraData = ManagedCameras[CurrentCameraIndex]; AActor* Camera = CameraData.Camera; float LinearBlend = CameraData.LinearBlend; if (Camera) { if (LinearBlend > 0.f) { PlayerController->SetViewTargetWithBlend(Camera, LinearBlend); } else { PlayerController->SetViewTarget(Camera); } } } CurrentCameraIndex++; CurrentCameraIndex = CurrentCameraIndex == ManagedCameras.Num() ? 0 : CurrentCameraIndex; TimeToNextCameraChange = ManagedCameras[CurrentCameraIndex].TransitionTime;}
开发者ID:dt100developer,项目名称:Cplusplus-UE4-Sections,代码行数:27,
示例14: Tick// Called every framevoid ACameraDirector::Tick(float DeltaTime){ Super::Tick(DeltaTime); const float TimeBetweenCameraChanges = 60.f; const float SmoothBlendTime = 59.0f; TimeToNextCameraChange -= DeltaTime; if (TimeToNextCameraChange <= 0.0f) { TimeToNextCameraChange += TimeBetweenCameraChanges; //Find actor that handles ctonrtol for local player. APlayerController* OurPlayerController = UGameplayStatics::GetPlayerController(this, 0); if (OurPlayerController) { if (CameraTwo && (OurPlayerController->GetViewTarget() == CameraOne)) { //Blend smoothly to camera two. OurPlayerController->SetViewTargetWithBlend(CameraTwo, SmoothBlendTime); } else if (CameraOne) { //Cut instantly to camera one. //OurPlayerController->SetViewTarget(CameraOne); OurPlayerController->SetViewTargetWithBlend(CameraOne, SmoothBlendTime); } } }}
开发者ID:Stiffrock,项目名称:SW_Project2,代码行数:36,
示例15: InitSeamlessTravelPlayervoid AGameModeBase::InitSeamlessTravelPlayer(AController* NewController){ APlayerController* NewPC = Cast<APlayerController>(NewController); // Find a start spot AActor* StartSpot = FindPlayerStart(NewController); if (StartSpot == nullptr) { UE_LOG(LogGameMode, Warning, TEXT("Could not find a starting spot")); } else { FRotator StartRotation(0, StartSpot->GetActorRotation().Yaw, 0); NewController->SetInitialLocationAndRotation(StartSpot->GetActorLocation(), StartRotation); } NewController->StartSpot = StartSpot; if (NewPC != nullptr) { NewPC->PostSeamlessTravel(); if (MustSpectate(NewPC)) { NewPC->StartSpectatingOnly(); } else { NewPC->bPlayerIsWaiting = true; NewPC->ChangeState(NAME_Spectating); NewPC->ClientGotoState(NAME_Spectating); } }}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:34,
示例16: switchvoid AUETutorialGameMode::HandleNewState(EUETutorialGameModeState State){ switch (State) { case EUETutorialGameModeState::EPlaying: { for (ASpawnVolume * Volume : SpawnVolumeActors) { Volume->EnableSpawning(); } break; } case EUETutorialGameModeState::EGameOver: { for (ASpawnVolume * Volume : SpawnVolumeActors) { Volume->DisableSpawning(); } APlayerController * PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0); PlayerController->SetCinematicMode(true, true, true); break; } case EUETutorialGameModeState::EUnknown: default: break; }}
开发者ID:maceman1984,项目名称:PowerUp-Tutorial,代码行数:27,
示例17: GenericPlayerInitializationvoid AGameModeBase::GenericPlayerInitialization(AController* C){ APlayerController* PC = Cast<APlayerController>(C); if (PC != nullptr) { InitializeHUDForPlayer(PC); // Notify the game that we can now be muted and mute others UpdateGameplayMuteList(PC); // Tell the player to enable voice by default or use the push to talk method PC->ClientEnableNetworkVoice(!GameSession->RequiresPushToTalk()); ReplicateStreamingStatus(PC); bool HidePlayer = false, HideHUD = false, DisableMovement = false, DisableTurning = false; // Check to see if we should start in cinematic mode (matinee movie capture) if (ShouldStartInCinematicMode(PC, HidePlayer, HideHUD, DisableMovement, DisableTurning)) { PC->SetCinematicMode(true, HidePlayer, HideHUD, DisableMovement, DisableTurning); } // Add the player to any matinees running so that it gets in on any cinematics already running, etc TArray<AMatineeActor*> AllMatineeActors; GetWorld()->GetMatineeActors(AllMatineeActors); for (int32 i = 0; i < AllMatineeActors.Num(); i++) { AllMatineeActors[i]->AddPlayerToDirectorTracks(PC); } }}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:32,
示例18: CheckShiftKeyvoid ATotemCharacter::CheckShiftKey(){ //For Sprint, designed only execute on owning client if (Controller) { if (Controller->IsLocalPlayerController()) { APlayerController* PlayerController = Cast<APlayerController>(Controller); if (PlayerController) { if (PlayerController->IsInputKeyDown(EKeys::LeftShift)) { // if no move state && on the ground if (TotemCharacterMoveState == ETotemCharacterMoveState::NoMove && GetCharacterMovement()->IsWalking()) { SetTotemCharacterMoveState(ETotemCharacterMoveState::Sprint); } } else { if (TotemCharacterMoveState == ETotemCharacterMoveState::Sprint) { SetTotemCharacterMoveState(ETotemCharacterMoveState::NoMove); } } } } }}
开发者ID:whiteeat,项目名称:TotemCodeSample,代码行数:29,
示例19: FindLockedDebugActorvoid FBehaviorTreeDebugger::FindLockedDebugActor(UWorld* World){ APlayerController* LocalPC = GEngine->GetFirstLocalPlayerController(World); if (LocalPC && LocalPC->GetHUD() && LocalPC->GetPawnOrSpectator()) { AGameplayDebuggingReplicator* DebuggingReplicator = NULL; for (TActorIterator<AGameplayDebuggingReplicator> It(World); It; ++It) { AGameplayDebuggingReplicator* A = *It; if (!A->IsPendingKill()) { DebuggingReplicator = A; break; } } const APawn* LockedPawn = DebuggingReplicator != NULL ? Cast<APawn>(DebuggingReplicator->GetSelectedActorToDebug()) : NULL; UBehaviorTreeComponent* TestInstance = FindInstanceInActor((APawn*)LockedPawn); if (TestInstance) { TreeInstance = TestInstance;#if USE_BEHAVIORTREE_DEBUGGER ActiveStepIndex = TestInstance->DebuggerSteps.Num() - 1;#endif } }}
开发者ID:Codermay,项目名称:Unreal4,代码行数:28,
示例20: UE_LOGvoid AGameSession::HandleMatchHasEnded(){ if (STATS && !UE_BUILD_SHIPPING) { if (FParse::Param(FCommandLine::Get(), TEXT("MatchAutoStatCapture"))) { UE_LOG(LogGameSession, Log, TEXT("Match has ended - end automatic stat capture")); GEngine->Exec(GetWorld(), TEXT("stat stopfile")); } } UWorld* World = GetWorld(); if (UOnlineEngineInterface::Get()->DoesSessionExist(World, SessionName)) { for (FConstPlayerControllerIterator Iterator = World->GetPlayerControllerIterator(); Iterator; ++Iterator) { APlayerController* PlayerController = *Iterator; if (!PlayerController->IsLocalController()) { PlayerController->ClientEndOnlineSession(); } } FOnlineSessionStartComplete CompletionDelegate = FOnlineSessionEndComplete::CreateUObject(this, &AGameSession::OnEndSessionComplete); UOnlineEngineInterface::Get()->EndSession(World, SessionName, CompletionDelegate); }}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:27,
示例21: Restartvoid APawn::PawnClientRestart(){ Restart(); APlayerController* PC = Cast<APlayerController>(Controller); if (PC && PC->IsLocalController()) { // Handle camera possession if (PC->bAutoManageActiveCameraTarget) { PC->AutoManageActiveCameraTarget(this); } // Set up player input component, if there isn't one already. if (InputComponent == NULL) { InputComponent = CreatePlayerInputComponent(); if (InputComponent) { SetupPlayerInputComponent(InputComponent); InputComponent->RegisterComponent(); if (UInputDelegateBinding::SupportsInputDelegate(GetClass())) { InputComponent->bBlockInput = bBlockInput; UInputDelegateBinding::BindInputDelegates(GetClass(), InputComponent); } } } }}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,
示例22: GetWorldvoid AAvatar::ToggleInventory(){ APlayerController* PController = GetWorld()->GetFirstPlayerController(); AMyHUD* hud = Cast<AMyHUD>( PController->GetHUD() ); // If inventory is displayed, undisplay it. if( inventoryShowing ) { hud->clearWidgets(); inventoryShowing = false; PController->bShowMouseCursor = false; return; } // Otherwise, display the player's inventory inventoryShowing = true; PController->bShowMouseCursor = true; for( TMap<FString,int>::TIterator it = Backpack.CreateIterator(); it; ++it ) { // Combine string name of the item, with qty eg Cow x 5 FString fs = it->Key + FString::Printf( TEXT(" x %d"), it->Value ); UTexture2D* tex = NULL; if( Icons.Find( it->Key ) ) { tex = Icons[it->Key]; Widget w( Icon( fs, tex ), Classes[it->Key] ); w.bpSpell = Spells[it->Key]; hud->addWidget( w ); } }}
开发者ID:phillzz,项目名称:GoldenEgg,代码行数:31,
示例23: GetOuterAPlayerControllervoid UCheatManager::TestCollisionDistance(){ APlayerController* PC = GetOuterAPlayerController(); if(PC) { // Get view location to act as start point FVector ViewLoc; FRotator ViewRot; PC->GetPlayerViewPoint(ViewLoc, ViewRot); FlushPersistentDebugLines( GetOuterAPlayerController()->GetWorld() );//change the GetWorld // calculate from viewloc for (FObjectIterator Iter(AVolume::StaticClass()); Iter; ++Iter) { AVolume * Volume = Cast<AVolume>(*Iter); if (Volume->GetClass()->GetDefaultObject() != Volume) { FVector ClosestPoint(0,0,0); float Distance = Volume->GetBrushComponent()->GetDistanceToCollision(ViewLoc, ClosestPoint); float NormalizedDistance = FMath::Clamp<float>(Distance, 0.f, 1000.f)/1000.f; FColor DrawColor(255*NormalizedDistance, 255*(1-NormalizedDistance), 0); DrawDebugLine(GetWorld(), ViewLoc, ClosestPoint, DrawColor, true); UE_LOG(LogCheatManager, Log, TEXT("Distance to (%s) is %0.2f"), *Volume->GetName(), Distance); } } }}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:30,
示例24: ue_py_checkPyObject *py_ue_is_input_key_down(ue_PyUObject *self, PyObject * args){ ue_py_check(self); char *key; int controller_id = 0; if (!PyArg_ParseTuple(args, "s|i:is_input_key_down", &key, &controller_id)) { return NULL; } UWorld *world = ue_get_uworld(self); if (!world) return PyErr_Format(PyExc_Exception, "unable to retrieve UWorld from uobject"); APlayerController *controller = UGameplayStatics::GetPlayerController(world, controller_id); if (!controller) return PyErr_Format(PyExc_Exception, "unable to retrieve controller %d", controller_id); if (controller->IsInputKeyDown(key)) { Py_INCREF(Py_True); return Py_True; } Py_INCREF(Py_False); return Py_False;}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:29,
示例25: GetWorldbool AOpenBarrierConsole::OnInteract(){ /*When the player interact with the console it activates the camera to enter in puzzle mode*/ UWorld* World = GetWorld(); if (World) { APlayerController* PlayerController = World->GetFirstPlayerController(); if (PlayerController) { ATGCOPlayerState* PlayerState = Cast<ATGCOPlayerState>(PlayerController->PlayerState); if (PlayerState) { if (PlayerState->eCurrentState == EPlayerStatus::IN_GAME) { PlayerState->SwitchGamePuzzle(CameraPuzzle); } else { if (PlayerState->eCurrentState == EPlayerStatus::IN_PUZZLE_GAME) { PlayerState->SwitchGamePuzzle(PlayerController->GetCharacter()); } } } } } return true;}
开发者ID:Onyrick,项目名称:TGCO,代码行数:28,
示例26: OnShowLoginUICompletedvoid UShowLoginUICallbackProxy::OnShowLoginUICompleted(TSharedPtr<const FUniqueNetId> UniqueId, int LocalPlayerNum){ // Update the cached unique ID for the local player and the player state. APlayerController* PlayerController = PlayerControllerWeakPtr.Get(); if (PlayerController != nullptr) { ULocalPlayer* LocalPlayer = PlayerController->GetLocalPlayer(); if (LocalPlayer != nullptr) { LocalPlayer->SetCachedUniqueNetId(UniqueId); } if (PlayerController->PlayerState != nullptr) { PlayerController->PlayerState->SetUniqueId(UniqueId); } } if (UniqueId.IsValid()) { OnSuccess.Broadcast(PlayerControllerWeakPtr.Get()); } else { OnFailure.Broadcast(PlayerControllerWeakPtr.Get()); }}
开发者ID:colwalder,项目名称:unrealengine,代码行数:28,
示例27: Turn// @TODO: DEPRECATED, remove.void ADefaultPawn::Turn(float Val){ APlayerController* PC = Cast<APlayerController>(GetController()); if (PC) { PC->AddYawInput(Val); }}
开发者ID:colwalder,项目名称:unrealengine,代码行数:9,
示例28: LookUp// @TODO: DEPRECATED, remove.void ADefaultPawn::LookUp(float Val){ APlayerController* PC = Cast<APlayerController>(GetController()); if (PC) { PC->AddPitchInput(Val); }}
开发者ID:colwalder,项目名称:unrealengine,代码行数:9,
注:本文中的APlayerController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ APoint类代码示例 C++ APawn类代码示例 |