ue4文档接口类学习

看了看Ue4文档中的接口类,摸索着进行了下,
在编辑器,先从Unreal interface派生个接口类ReceiveHttpInterface
废话不多说,上代码
接口类文件
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include “CoreMinimal.h”
#include “UObject/Interface.h”
#include “ReceiveHttpInterface.generated.h”

// This class does not need to be modified.
UINTERFACE(MinimalAPI, Blueprintable)
class UReceiveHttpInterface : public UInterface
{
GENERATED_BODY()
};

/**
*
*/
class AIRLINEDEMO_FUKE_API IReceiveHttpInterface
{
GENERATED_BODY()

public:
virtual void ReciveHttpDataPlaceActor(const TArray< MyData>& data)
{}

};

派生自该接口类
头文件
UCLASS()
class AIRLINEDEMO_FUKE_API APlacementActor : public AActor, public IReceiveHttpInterface
{
。。。。。。。。。。
public:
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void ReciveHttpDataPlaceActor(const TArray< MyData>& data) ;

};
实现文件

void APlacementActor::ReciveHttpDataPlaceActor_Implementation(const TArray< MyData>& data)
{
//GenerateActorArray(data);
}

然后就Ok了在蓝图中,也能使用了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值