2024-04-12 23:31:49 -07:00
|
|
|
|
#include "GasaLevelScriptActor.h"
|
|
|
|
|
|
|
|
|
|
#include "GasaDevOptions.h"
|
|
|
|
|
#include "Kismet/GameplayStatics.h"
|
|
|
|
|
|
|
|
|
|
void AGasaLevelScriptActor::BeginPlay()
|
|
|
|
|
{
|
|
|
|
|
Super::BeginPlay();
|
|
|
|
|
|
2024-04-13 02:32:52 -07:00
|
|
|
|
using namespace Gasa;
|
|
|
|
|
|
2024-04-12 23:31:49 -07:00
|
|
|
|
TArray<AActor*> TaggedActors;
|
2024-04-13 02:32:52 -07:00
|
|
|
|
UGameplayStatics::GetAllActorsWithTag(GetWorld(), GetDevOptions()->Tag_GlobalPPV, TaggedActors);
|
2024-04-12 23:31:49 -07:00
|
|
|
|
for (AActor* Actor : TaggedActors)
|
|
|
|
|
{
|
|
|
|
|
GlobalPPV = Cast<APostProcessVolume>(Actor);
|
|
|
|
|
|
2024-04-13 02:32:52 -07:00
|
|
|
|
APostProcessVolume* PPV = GetLevelActor(this)->GlobalPPV;
|
2024-04-12 23:31:49 -07:00
|
|
|
|
UMaterialInstance* Blendable = Cast<UMaterialInstance>(PPV->Settings.WeightedBlendables.Array[0].Object);
|
|
|
|
|
UMaterialInstanceDynamic* MID = UMaterialInstanceDynamic::Create(Blendable, this);
|
|
|
|
|
PPV->Settings.WeightedBlendables.Array[0].Object = MID;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|