// Fill out your copyright notice in the Description page of Project Settings. #include "BuildingProcedural.h" // Sets default values ABuildingProcedural::ABuildingProcedural() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; RootComponent = CreateDefaultSubobject(TEXT("RootComponent")); } // Called when the game starts or when spawned void ABuildingProcedural::BeginPlay() { Super::BeginPlay(); } // Called every frame void ABuildingProcedural::Tick(float DeltaTime) { Super::Tick(DeltaTime); } void ABuildingProcedural::ShowCurrentIndex(int32 Index, TArray ProceduralMeshes) { int32 i; for (i = 0; i < ProceduralMeshes.Num(); ++i) { if (i <= Index) { ProceduralMeshes[i]->SetHiddenInGame(false); } } for (i = 0; i < ProceduralMeshes.Num(); ++i) { if (i >= Index) { ProceduralMeshes[i]->SetHiddenInGame(true); } } } void ABuildingProcedural::ResetMeshSections(TArray ProceduralMeshes) { //ProceduralMeshes[i]->GetProcMeshSection(0); for (auto& ProcMesh : ProceduralMeshes) { for (int i = 0; i < ProcMesh->GetNumSections(); ++i) { ProcMesh->GetProcMeshSection(i)->Reset(); //ProcMesh->GetProcMeshSection(i)-> //ProcMesh->SetProcMeshSection //ProcMesh->SetProcMeshSection(); //FProcMeshSection ProcMeshSection; //StaticMesh } } }