Add Niagara system to pickups
This commit is contained in:
parent
5e2028c529
commit
f42cd6c028
BIN
Content/Pickups/EXP/BP_PickupTemplate.uasset
(Stored with Git LFS)
BIN
Content/Pickups/EXP/BP_PickupTemplate.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Pickups/NS_Pickup.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Pickups/NS_Pickup.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -10,6 +10,7 @@
|
|||||||
#include "PickupDataAsset.h"
|
#include "PickupDataAsset.h"
|
||||||
#include "GameFramework/GameModeBase.h"
|
#include "GameFramework/GameModeBase.h"
|
||||||
#include "Interfaces/Pools.h"
|
#include "Interfaces/Pools.h"
|
||||||
|
#include "NiagaraComponent.h"
|
||||||
|
|
||||||
// Sets default values
|
// Sets default values
|
||||||
APickup::APickup()
|
APickup::APickup()
|
||||||
@ -43,6 +44,10 @@ APickup::APickup()
|
|||||||
|
|
||||||
onTimelineCallback.BindUFunction(this, FName(TEXT("TimelineCallback")));
|
onTimelineCallback.BindUFunction(this, FName(TEXT("TimelineCallback")));
|
||||||
onTimelineFinishedCallback.BindUFunction(this, FName(TEXT("TimelineFinishedCallback")));
|
onTimelineFinishedCallback.BindUFunction(this, FName(TEXT("TimelineFinishedCallback")));
|
||||||
|
|
||||||
|
NiagaraComponent = CreateDefaultSubobject<UNiagaraComponent>(TEXT("Niagara Component"));
|
||||||
|
NiagaraComponent->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
|
||||||
|
NiagaraComponent->DeactivateImmediate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "Interfaces/Pickupable.h"
|
#include "Interfaces/Pickupable.h"
|
||||||
#include "Pickup.generated.h"
|
#include "Pickup.generated.h"
|
||||||
|
|
||||||
|
class UNiagaraComponent;
|
||||||
class UPickupDataAsset;
|
class UPickupDataAsset;
|
||||||
class UTimelineComponent;
|
class UTimelineComponent;
|
||||||
class USphereComponent;
|
class USphereComponent;
|
||||||
@ -39,6 +40,9 @@ public:
|
|||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Timeline")
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Timeline")
|
||||||
TObjectPtr<UCurveFloat> CurveFloat;
|
TObjectPtr<UCurveFloat> CurveFloat;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
|
TObjectPtr<UNiagaraComponent> NiagaraComponent = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FOnTimelineFloat onTimelineCallback;
|
FOnTimelineFloat onTimelineCallback;
|
||||||
FOnTimelineEventStatic onTimelineFinishedCallback;
|
FOnTimelineEventStatic onTimelineFinishedCallback;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user