Implemented Dialogue System using dialogue Component and Interface, make Dialogue UI Prototype, and change the data type of the characters to be displayed in the UI in source code
28 lines
835 B
C++
28 lines
835 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "HYManualPickUp.h"
|
|
#include "HYPlayerCharacController.h"
|
|
|
|
AHYManualPickUp::AHYManualPickUp()
|
|
{
|
|
PickUpRangeMesh = CreateDefaultSubobject<UStaticMeshComponent>("PickupMesh");
|
|
RootComponent = Cast<USceneComponent>(PickUpRangeMesh);
|
|
|
|
ItemID = FName("No ID");
|
|
|
|
Super::Name = NSLOCTEXT("HYManualPickUp", "InteractionName", "Item");
|
|
Super::Action = NSLOCTEXT("HYManualPickUp", "InteractionAction", "pick up");
|
|
}
|
|
|
|
void AHYManualPickUp::Interact_Implementation(APlayerController* Controller)
|
|
{
|
|
Super::Interact_Implementation(Controller);
|
|
|
|
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(Controller);
|
|
if (IController->AddItemToInventoryByID(ItemID))
|
|
Destroy();
|
|
else UE_LOG(LogTemp, Warning, TEXT("Item not found."))
|
|
}
|
|
|