代码问题。

[复制链接]
mknmknmk | 2017-12-7 09:10:46 | 显示全部楼层
本帖最后由 mknmknmk 于 2017-12-7 09:55 编辑

AMyActor::AMyActor(UTexture2D* PickUpTexture, class Actor* PickUpClass, FString PickUpName)

这样的构造函数不允许

应该这样写
UCLASS()
class RMC_EXAMPLES_API ARuntimeMeshObjectBase : public AActor
{
        GENERATED_BODY()
       
public:       

        UPROPERTY(EditAnywhere)
        URuntimeMeshComponent* RuntimeMesh;
       
        // Sets default values for this actor's properties
        ARuntimeMeshObjectBase();

        // Called when the game starts or when spawned
        virtual void BeginPlay() override;
       
        // Called every frame
        virtual void Tick( float DeltaSeconds ) override;

};

ARuntimeMeshObjectBase::ARuntimeMeshObjectBase()
{
        // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
        PrimaryActorTick.bCanEverTick = true;


        RuntimeMesh = CreateDefaultSubobject<URuntimeMeshComponent>(TEXT("Runtime Mesh"));
        RootComponent = RuntimeMesh;
}

// Called when the game starts or when spawned
void ARuntimeMeshObjectBase::BeginPlay()
{
        Super::BeginPlay();
       
}

// Called every frame
void ARuntimeMeshObjectBase::Tick( float DeltaTime )
{
        Super::Tick( DeltaTime );

}

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则