작성 코드

.h

 
#pragma once  
  
#include "CoreMinimal.h"  
#include "UObject/Interface.h"  
#include "ItemInterface.generated.h"  
  
UINTERFACE(MinimalAPI)  
class UItemInterface : public UInterface
{  
    GENERATED_BODY()  
};  
  
class COINGAME_API IItemInterface  
{  
    GENERATED_BODY()  
  
public:  
    UFUNCTION()  
    virtual void OnItemOverlap(
          UPrimitiveComponent* OverlappedComp,  
          AActor* OtherActor,  
          UPrimitiveComponent* OtherComp,  
          int32 OtherBodyIndex,  
          bool bFromSweep,  
          const FHitResult& SweepResult) = 0;
          
    UFUNCTION()  
    virtual void OnItemEndOverlap(  
          UPrimitiveComponent* OverlappedComp,  
          AActor* OtherActor,  
          UPrimitiveComponent* OtherComp,  
          int32 OtherBodyIndex) = 0;  
    
    virtual void ActivateItem(AActor* Activator) = 0;  
    
    virtual FName GetItemType() const = 0;  
    
};
 

.cpp

//없음

자세한 설명

.h

 
 
 

.cpp