Add campfire smoke placeholder
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "AgrarianGameCharacter.h"
|
||||
#include "AgrarianInventoryComponent.h"
|
||||
#include "AgrarianSurvivalComponent.h"
|
||||
#include "Particles/ParticleSystemComponent.h"
|
||||
#include "Components/PointLightComponent.h"
|
||||
#include "Components/StaticMeshComponent.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
@@ -22,6 +23,12 @@ AAgrarianCampfire::AAgrarianCampfire()
|
||||
FireLight->SetIntensity(0.0f);
|
||||
FireLight->SetAttenuationRadius(WarmthRadius);
|
||||
FireLight->SetLightColor(FLinearColor(1.0f, 0.45f, 0.18f));
|
||||
|
||||
SmokeEffect = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("SmokeEffect"));
|
||||
SmokeEffect->SetupAttachment(RootComponent);
|
||||
SmokeEffect->bAutoActivate = false;
|
||||
SmokeEffect->SetRelativeLocation(FVector(0.0f, 0.0f, 80.0f));
|
||||
SmokeEffect->SetVisibility(false);
|
||||
}
|
||||
|
||||
void AAgrarianCampfire::Tick(float DeltaSeconds)
|
||||
@@ -140,6 +147,19 @@ void AAgrarianCampfire::UpdateVisualState()
|
||||
{
|
||||
FireLight->SetIntensity(bLit ? 4200.0f : 0.0f);
|
||||
}
|
||||
|
||||
if (SmokeEffect)
|
||||
{
|
||||
SmokeEffect->SetVisibility(bLit);
|
||||
if (bLit)
|
||||
{
|
||||
SmokeEffect->ActivateSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
SmokeEffect->DeactivateSystem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AAgrarianCampfire::WarmNearbyCharacters(float DeltaSeconds)
|
||||
|
||||
Reference in New Issue
Block a user