在公司学习UE4下的C++代码编程时,依照《Unreal Engine4总动员》上的示例编写代码时,总是发生代码六的错误以及一些莫名其妙的错误。下图是书上示例:
这是我敲的代码:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Foat.generated.h"
UCLASS()
class QUICKSTART_API AFoat : public AActor
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
int32 TotalDamage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
float DamageTimeInSecond;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Transient, Category = "Damage")
float DamagePerSecond;
public:
// Sets default values for this actor's properties
AFoat();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Ti