Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "GameFramework/Actor.h"
- #include "LocalWeather.generated.h"
- UCLASS()
- class SURVIVALGAME_API ALocalWeather : public AActor
- {
- GENERATED_BODY()
- public:
- UParticleSystemComponent *particleSystemComponent;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visual Effects")
- UParticleSystem *precipitationParticleSystem;
- // Sets default values for this actor's properties
- ALocalWeather();
- // Called when the game starts or when spawned
- virtual void BeginPlay() override;
- // Called every frame
- virtual void Tick( float DeltaSeconds ) override;
- };
- #include "SurvivalGame.h"
- #include "LocalWeather.h"
- // Sets default values
- ALocalWeather::ALocalWeather()
- {
- // 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;
- particleSystemComponent = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("RainParticles"));
- if (precipitationParticleSystem != NULL)
- {
- particleSystemComponent->SetTemplate(precipitationParticleSystem);
- }
- particleSystemComponent->AttachTo(RootComponent);
- }
- // Called when the game starts or when spawned
- void ALocalWeather::BeginPlay()
- {
- Super::BeginPlay();
- }
- // Called every frame
- void ALocalWeather::Tick( float DeltaTime )
- {
- Super::Tick( DeltaTime );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement