Hello
Been working on a plugin to generate Landscapes along with it’s proxies.
After declaring the TArray in .h and checking its size in .cpp it says ~7500000
despite not adding any elements to it. Tiles is a class meant to hold information of each proxy. What could be the problem?
.h
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "Landscape.h"
#include "Containers/Array.h"
#include "LandscapeProxy.h"
#include "LandscapeInfo.h"
#include "Tile.h"
class FToolBarBuilder;
class FMenuBuilder;
class FProceduralWorldModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
FReply Setup();
FReply DeleteLandscape();
/** This function will be bound to Command (by default it will bring up plugin window) */
void PluginButtonClicked();
//member variable for landscape we are creating
UPROPERTY()
ALandscape* landscapePtr{nullptr};
TArray<Tile> tiles;
private:
void RegisterMenus();
TSharedRef<class SDockTab> OnSpawnPluginTab(const class FSpawnTabArgs& SpawnTabArgs);
private:
TSharedPtr<class FUICommandList> PluginCommands;
};
.cpp
UE_LOG(LogTemp, Warning, TEXT("Num of tiles: %d"), tiles.Num());
if (!tiles.IsEmpty())
{
UE_LOG(LogTemp, Warning, TEXT("tiles is not empty"));
}
Tile.h
class PROCEDURALWORLD_API Tile
{
public:
Tile();
Tile(TObjectPtr<ALandscapeStreamingProxy> inProxy);
~Tile() = default;
void updateMaterial(UMaterial* inMaterial);
void updateAdjacentTiles(TArray<Tile> &inTiles, const uint32 gridSizeProxy);
UPROPERTY()
TObjectPtr<ALandscapeStreamingProxy> streamingProxy = nullptr;
UPROPERTY()
UMaterial* tileMaterial = nullptr;
bool isCity = false;
bool isRoad = false;
//Addd more (dungeons, biotope, river, lakes)
int32 index{0};
TArray<Tile*> adjacentTiles;
//TStaticArray<Tile*> asd[8]{ nullptr };
};