47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "../Weapon.h"
|
|
#include "vampires/Projectile.h"
|
|
#include "ProjectileWeapon.generated.h"
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class VAMPIRES_API AProjectileWeapon : public AWeapon
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
USphereComponent* SphereComponent = nullptr;
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Weapon Properties")
|
|
TSubclassOf<AProjectile> ProjectileTemplate = nullptr;
|
|
|
|
protected:
|
|
TArray<AActor*> OverlappedEnemies = TArray<AActor*>();
|
|
|
|
public:
|
|
AProjectileWeapon();
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
|
|
public:
|
|
UFUNCTION()
|
|
void OnWeaponBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
|
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep,
|
|
const FHitResult& SweepResult);
|
|
|
|
UFUNCTION()
|
|
void OnWeaponEndOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp,
|
|
int32 OtherBodyIndex);
|
|
|
|
UFUNCTION()
|
|
void OnProjectileBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
|
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
|
|
};
|