111 lines
4.0 KiB
C++
111 lines
4.0 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Actor.h"
|
|
#include "Engine/DirectionalLight.h"
|
|
#include "Components/DirectionalLightComponent.h"
|
|
#include "Engine/SkyLight.h"
|
|
#include "Components/SkyLightComponent.h"
|
|
#include "Engine/ExponentialHeightFog.h"
|
|
#include <Components/SkyAtmosphereComponent.h>
|
|
#include "Components/ExponentialHeightFogComponent.h"
|
|
#include <Curves/CurveVector.h>
|
|
#include "NiagaraComponent.h"
|
|
#include "Kismet/GameplayStatics.h"
|
|
#include "GameFramework/Pawn.h"
|
|
#include "Components/SceneComponent.h"
|
|
#include "WheatherSystem.generated.h"
|
|
|
|
/** Please add a class description */
|
|
UCLASS(Blueprintable, BlueprintType)
|
|
class NESIANDMYPROJECT_API AWheatherSystem : public AActor
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
// Sets default values for this actor's properties
|
|
AWheatherSystem();
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
public:
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
public:
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Components")
|
|
TObjectPtr<UNiagaraComponent> RainComponent;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Components")
|
|
TObjectPtr<UNiagaraComponent> SnowComponent;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditInstanceOnly, Category = "Standard")
|
|
TObjectPtr<ADirectionalLight> Sun;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditInstanceOnly, Category = "Standard")
|
|
TObjectPtr<ADirectionalLight> Moon;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditInstanceOnly, Category = "Standard")
|
|
TObjectPtr<ASkyLight> SkyLight;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditInstanceOnly, Category = "Standard")
|
|
TObjectPtr<ASkyAtmosphere> SkyAtmosphere;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditInstanceOnly, Category = "Standard")
|
|
TObjectPtr<AExponentialHeightFog> Fog;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Standard")
|
|
double CurrentTime;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Standard")
|
|
double DayLengthMiutes;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveFloat> DayCurve;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
double OneHoure;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveVector> SunlightItensity;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveVector> SkylightIntensity;
|
|
/** Please add a variable description */
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveFloat> WeatherTypeCurve;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveFloat> FogTimelineCurve;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveFloat> RainTimelineCurve;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveFloat> SnowTimelineCurve;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "Standard")
|
|
TObjectPtr<UCurveFloat> FogHeightFalloffCurve;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Standard")
|
|
bool bFog = false;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Standard")
|
|
bool bRain = false;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Standard")
|
|
bool bSnow = false;
|
|
|
|
private:
|
|
void UpdateWeather();
|
|
void UpdateRain();
|
|
void UpdateSnow();
|
|
void UpdateFog();
|
|
float MaxSnow = 0.0;
|
|
float MaxRain = 0.0;
|
|
};
|