下記のように独自クラスを作るという書き方をして、その後、testクラスの中のx変数をブループリントに公開して操作したいのですが、エラーばかり出てしまい、出来ません。
そもそも、このような書き方は間違っているのでしょうか?
//UCLASS()をつけたいが、
// Error: Invalid class name 'test'. The class name must have an appropriate prefix added (A for Actors, U for other classes).が発生してしまう。
class MYPROJECT_API test
{
public:
test();
~test();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Simulation")
int x;
UFUNCTION(BlueprintCallable, Category = "Simulation")
void run();
};
UCLASS(Blueprintable , BlueprintType)
class AMyGameMode : public AGameModeBase
{
GENERATED_BODY()
public:
AMyGameMode();
virtual void BeginPlay() override;
virtual void Tick(float DeltaTime) override;
//UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Simulation")をつけたいが
// Unrecognized type 'test' - type must be a UCLASS, USTRUCT or UENUM が発生してしまう
test s;
// 問題なし
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Simulation")
int32 aa;
};