Illusion-UE5/hwanyoung2/Source/hwanyoung2/HYMoneyAutoPickUp.cpp

19 lines
461 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "HYMoneyAutoPickUp.h"
#include "HYPlayerCharacController.h"
AHYMoneyAutoPickUp::AHYMoneyAutoPickUp()
{
Super::ItemID = FName("Lost soul");
Value = 1;
}
void AHYMoneyAutoPickUp::Collect_Implementation(APlayerController* Controller)
{
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(Controller);
IController->Currency += Value;
Destroy();
}