Advertisement
Guest User

Untitled

a guest
May 30th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.36 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "GameFramework/Actor.h"
  4. #include "LocalWeather.generated.h"
  5.  
  6. UCLASS()
  7. class SURVIVALGAME_API ALocalWeather : public AActor
  8. {
  9.     GENERATED_BODY()
  10.    
  11. public:
  12.     UParticleSystemComponent *particleSystemComponent;
  13.  
  14.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visual Effects")
  15.         UParticleSystem *precipitationParticleSystem;
  16.  
  17.     // Sets default values for this actor's properties
  18.     ALocalWeather();
  19.  
  20.     // Called when the game starts or when spawned
  21.     virtual void BeginPlay() override;
  22.    
  23.     // Called every frame
  24.     virtual void Tick( float DeltaSeconds ) override;
  25. };
  26.  
  27.  
  28.  
  29.  
  30. #include "SurvivalGame.h"
  31. #include "LocalWeather.h"
  32.  
  33.  
  34. // Sets default values
  35. ALocalWeather::ALocalWeather()
  36. {
  37.     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
  38.     PrimaryActorTick.bCanEverTick = true;
  39.  
  40.     particleSystemComponent = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("RainParticles"));
  41.  
  42.     if (precipitationParticleSystem != NULL)
  43.     {
  44.         particleSystemComponent->SetTemplate(precipitationParticleSystem);
  45.     }
  46.  
  47.     particleSystemComponent->AttachTo(RootComponent);
  48. }
  49.  
  50. // Called when the game starts or when spawned
  51. void ALocalWeather::BeginPlay()
  52. {
  53.     Super::BeginPlay();
  54. }
  55.  
  56. // Called every frame
  57. void ALocalWeather::Tick( float DeltaTime )
  58. {
  59.     Super::Tick( DeltaTime );
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement