Add Ribbon effect to Particles
This commit is contained in:
parent
e1b70b092d
commit
4fe6cc1281
File diff suppressed because one or more lines are too long
BIN
Content/Weapons/DA_Projectile.uasset
(Stored with Git LFS)
BIN
Content/Weapons/DA_Projectile.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Weapons/MagicWand/BP_MagicWandProjectile.uasset
(Stored with Git LFS)
BIN
Content/Weapons/MagicWand/BP_MagicWandProjectile.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Weapons/NS_BulletRibbon.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Weapons/NS_BulletRibbon.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "EnemyCharacter.h"
|
#include "EnemyCharacter.h"
|
||||||
#include "HealthComponent.h"
|
#include "HealthComponent.h"
|
||||||
|
#include "NiagaraComponent.h"
|
||||||
#include "ObjectPoolManager.h"
|
#include "ObjectPoolManager.h"
|
||||||
#include "ProjectileDataAsset.h"
|
#include "ProjectileDataAsset.h"
|
||||||
#include "Components/SphereComponent.h"
|
#include "Components/SphereComponent.h"
|
||||||
@ -34,6 +35,10 @@ AProjectile::AProjectile()
|
|||||||
StaticMeshComponent->SetEnableGravity(false);
|
StaticMeshComponent->SetEnableGravity(false);
|
||||||
StaticMeshComponent->SetGenerateOverlapEvents(false);
|
StaticMeshComponent->SetGenerateOverlapEvents(false);
|
||||||
StaticMeshComponent->SetCollisionProfileName(TEXT("NoCollision"));
|
StaticMeshComponent->SetCollisionProfileName(TEXT("NoCollision"));
|
||||||
|
|
||||||
|
NiagaraRibbonComponent = CreateDefaultSubobject<UNiagaraComponent>(TEXT("Niagara Ribbon Component"));
|
||||||
|
NiagaraRibbonComponent->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
|
||||||
|
NiagaraRibbonComponent->DeactivateImmediate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
@ -70,6 +75,8 @@ void AProjectile::LoadDataFromDataAsset_Implementation(UProjectileDataAsset* pro
|
|||||||
ProjectileMovement->InitialSpeed = ProjectileSpeed;
|
ProjectileMovement->InitialSpeed = ProjectileSpeed;
|
||||||
ProjectileMovement->MaxSpeed = ProjectileSpeed;
|
ProjectileMovement->MaxSpeed = ProjectileSpeed;
|
||||||
RemainingDamagableEnemies = projectileDataAsset->DamagableEnemies;
|
RemainingDamagableEnemies = projectileDataAsset->DamagableEnemies;
|
||||||
|
NiagaraRibbonComponent->SetAsset(projectileDataAsset->NiagaraRibbonSystem);
|
||||||
|
NiagaraRibbonComponent->ActivateSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AProjectile::ResetData_Implementation()
|
void AProjectile::ResetData_Implementation()
|
||||||
@ -77,6 +84,8 @@ void AProjectile::ResetData_Implementation()
|
|||||||
ProjectileSpeed = NULL;
|
ProjectileSpeed = NULL;
|
||||||
StaticMeshComponent->SetStaticMesh(nullptr);
|
StaticMeshComponent->SetStaticMesh(nullptr);
|
||||||
RemainingDamagableEnemies = 1;
|
RemainingDamagableEnemies = 1;
|
||||||
|
NiagaraRibbonComponent->DeactivateImmediate();
|
||||||
|
NiagaraRibbonComponent->SetAsset(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AProjectile::OnProjectileBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
void AProjectile::OnProjectileBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
||||||
@ -106,7 +115,8 @@ void AProjectile::OnProjectileBeginOverlap(UPrimitiveComponent* OverlappedCompon
|
|||||||
|
|
||||||
if (UKismetSystemLibrary::DoesImplementInterface(gamemode, UPools::StaticClass()))
|
if (UKismetSystemLibrary::DoesImplementInterface(gamemode, UPools::StaticClass()))
|
||||||
{
|
{
|
||||||
if (AObjectPoolManager* objectPoolManager = IPools::Execute_GetProjectileObjectPoolManager(gamemode))
|
if (AObjectPoolManager* objectPoolManager =
|
||||||
|
IPools::Execute_GetProjectileObjectPoolManager(gamemode))
|
||||||
{
|
{
|
||||||
objectPoolManager->ReturnObject(this);
|
objectPoolManager->ReturnObject(this);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "Interfaces/Projectilable.h"
|
#include "Interfaces/Projectilable.h"
|
||||||
#include "Projectile.generated.h"
|
#include "Projectile.generated.h"
|
||||||
|
|
||||||
|
class UNiagaraComponent;
|
||||||
class UProjectileMovementComponent;
|
class UProjectileMovementComponent;
|
||||||
class USphereComponent;
|
class USphereComponent;
|
||||||
class UProjectileDataAsset;
|
class UProjectileDataAsset;
|
||||||
@ -34,6 +35,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int RemainingDamagableEnemies = 1;
|
int RemainingDamagableEnemies = 1;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
|
TObjectPtr<UNiagaraComponent> NiagaraRibbonComponent = nullptr;
|
||||||
|
|
||||||
// Sets default values for this actor's properties
|
// Sets default values for this actor's properties
|
||||||
AProjectile();
|
AProjectile();
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "Engine/DataAsset.h"
|
#include "Engine/DataAsset.h"
|
||||||
#include "ProjectileDataAsset.generated.h"
|
#include "ProjectileDataAsset.generated.h"
|
||||||
|
|
||||||
|
class UNiagaraSystem;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -23,4 +24,7 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
int DamagableEnemies = 1;
|
int DamagableEnemies = 1;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere)
|
||||||
|
TObjectPtr<UNiagaraSystem> NiagaraRibbonSystem = nullptr;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user