How to make this on c++, I already make DT, Structure, Enum in C++, make Enum variable, but how to ger row and apply to mesh i can’t finde… this is sompthing like:
FItemStruct* Item = MyCustomDataTable->FindRow<FItemStruct>(DT_RowNames);
.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Engine/DataTable.h"
#include "Item.generated.h"
class UDataTable;
UENUM(BlueprintType)
enum EItemThisg
{
Axe UMETA(DisplayName = "Axe"),
■■■■■ UMETA(DisplayName = "■■■■■"),
Hammer UMETA(DisplayName = "Hammer")
};
USTRUCT(BlueprintType)
struct FItemStruct : public FTableRowBase
{
GENERATED_BODY()
/** Item static mesh **/
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UStaticMesh* ItemMesh;
/**Item description**/
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FString Description;
struct FDataTableRowHandle* RowHandler;
};
UCLASS()
class MYPROJECT3_API AItem : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AItem();
UPROPERTY(VisibleAnywhere, blueprintReadOnly, Category = "Item")
UStaticMeshComponent* MeshComp;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "DataTable")
UDataTable* MyCustomDataTable;
/*
UFUNCTION(Category = "DataTable")
TArray<FName> DataValue (UDataTable* Data);
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "DataTable")
TEnumAsByte<EItemThisg> DT_RowNames;
protected:
virtual void BeginPlay() override;
public:
};