So first I Import my CSV file into editor, here is a sample of it:
,itemNumber,xpos,ypos,zpos,xrot,yrot,zrot,itemType,option01,option02,option03
0,0,1,1,0,0,0,0,wall,0,0,0
1,1,2,1,0,0,0,0,wall,0,0,0
2,2,3,1,0,0,0,0,wall,0,0,0
3,3,3,2,0,0,0,90,wall,0,0,0
4,3,3,2,0,0,0,90,wall,0,0,0
Then define this line to get the CSV data into my code:
.h file
UDataTable* ItemData;
.cpp file
static ConstructorHelpers::FObjectFinder<UDataTable> temp(TEXT("DataTable'/Game/Data/ItemData.ItemData'"));
ItemData = temp.Object;
And everything looks fine. Then I try to iterate through the items. And please jhelp me, not sure how to do it…
if (ItemData != nullptr) {
//// ????????????
}