Rename entire project to LuckyWorldV2, including uproject file, folders and so on

This commit is contained in:
martinluckyrobots
2025-04-12 11:24:29 +08:00
parent cc578afffb
commit 8556492849
57 changed files with 40 additions and 39 deletions

View File

@ -0,0 +1,57 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "TP_VehicleAdvPlayerController.h"
#include "TP_VehicleAdvPawn.h"
#include "TP_VehicleAdvUI.h"
#include "EnhancedInputSubsystems.h"
#include "ChaosWheeledVehicleMovementComponent.h"
void ATP_VehicleAdvPlayerController::BeginPlay()
{
Super::BeginPlay();
// spawn the UI widget and add it to the viewport
VehicleUI = CreateWidget<UTP_VehicleAdvUI>(this, VehicleUIClass);
check(VehicleUI);
VehicleUI->AddToViewport();
}
void ATP_VehicleAdvPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
// get the enhanced input subsystem
if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
{
// add the mapping context so we get controls
Subsystem->AddMappingContext(InputMappingContext, 0);
// optionally add the steering wheel context
if (bUseSteeringWheelControls && SteeringWheelInputMappingContext)
{
Subsystem->AddMappingContext(SteeringWheelInputMappingContext, 1);
}
}
}
void ATP_VehicleAdvPlayerController::Tick(float Delta)
{
Super::Tick(Delta);
if (IsValid(VehiclePawn) && IsValid(VehicleUI))
{
VehicleUI->UpdateSpeed(VehiclePawn->GetChaosVehicleMovement()->GetForwardSpeed());
VehicleUI->UpdateGear(VehiclePawn->GetChaosVehicleMovement()->GetCurrentGear());
}
}
void ATP_VehicleAdvPlayerController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
// get a pointer to the controlled pawn
VehiclePawn = CastChecked<ATP_VehicleAdvPawn>(InPawn);
}