check(DefaultPawnClass); PlayerControllerClass = APGPlayerController::StaticClass();staticautoHUDBlueprintClassName = TEXT("WidgetBlueprint'/Game/Blueprints/BatteryHUD.BatteryHUD_C'");staticautoHUDFinder = ConstructorHelpers::FClassFinder<UUserWidget>(HUDBlueprintClassName);if(HUDFinder.Succeeded()) {...
} 开发者ID:ntk4,项目名称:UE4TopDownCamera,代码行数:28,代码来源:TDCSpectatorPawnMovement.cpp voidAGameModeBase::HandleSeamlessTravelPlayer(AController*& C) {// Default behavior is to spawn new controllers and copy dataAPlayerController* PC = Cast<APlayerController>(C);if(PC && PC->Player) ...
我這裡使用兩張PNG圖片,導入UE4即可。 4,編寫自定義UserWidget的C++代碼 添加需要的頭文件,比如我們在頭文件中使用了UImage,那麼需要指明這個UImage所在的頭文件。例如: #include "Components/Image.h" 具體代碼如下: UMGTestGameModeBase.h // Fill out your copyright notice in the Description page of Project...