下面是一个简单的接口示例:
#pragma once
#include "CoreMinimal.h"
#include "DoSomeThings.generated.h"
UINTERFACE(MinimalAPI)
class UDoSomeThings : public UInterface
{
GENERATED_BODY()
// This will always be empty!
};
class YOURPROJECT_API IDoSomeThings
{
GENERATED_BODY()
public:
// Get the number of things
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category="Things")
int GetNumberOfThings();
};