Changed TempCharacter to cache InventoryUI

This commit is contained in:
MarcelHara 2023-05-13 16:27:39 +01:00
parent 5dce69aad0
commit 5ec863f4cf
2 changed files with 5 additions and 5 deletions

View File

@ -54,9 +54,9 @@ void ATempCharacter::BeginPlay()
// ImportantStatsWidget->SetVisibility(ESlateVisibility::Visible);
// ImportantStatsWidget->AddToViewport();
MainMenuWidget = CreateWidget<UUserWidget>(GetWorld(), MainMenuSub);
MainMenuWidget->SetVisibility(ESlateVisibility::Hidden);
MainMenuWidget->AddToViewport();
InventoryWidget = CreateWidget<UUserWidget>(GetWorld(), InventoryMenuSub);
InventoryWidget->SetVisibility(ESlateVisibility::Hidden);
InventoryWidget->AddToViewport();
}
//Binds the input we made in the setup player component to the forward vector

View File

@ -119,13 +119,13 @@ public:
UUserWidget* ImportantStats;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* MainMenuWidget;
UUserWidget* InventoryWidget;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> ImportantStatsSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> MainMenuSub;
TSubclassOf<UUserWidget> InventoryMenuSub;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> CrossHairSub;