2022-11-29 00:23:15 +00:00
|
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Components/ActorComponent.h"
|
2023-01-31 01:48:35 +00:00
|
|
|
|
#include "NiagaraFunctionLibrary.h"
|
2023-04-26 01:10:01 +00:00
|
|
|
|
#include "Components/RadialSlider.h"
|
2023-04-26 04:51:07 +00:00
|
|
|
|
#include "BehaviorTree/BlackboardComponent.h"
|
2022-11-29 00:23:15 +00:00
|
|
|
|
#include "HoldToInitCombat.generated.h"
|
|
|
|
|
|
2023-01-31 01:48:35 +00:00
|
|
|
|
class UNiagaraSystem;
|
2022-11-29 00:23:15 +00:00
|
|
|
|
|
|
|
|
|
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
|
|
|
|
|
class THE_TWILIGHT_ABYSS_API UHoldToInitCombat : public UActorComponent
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// Sets default values for this component's properties
|
|
|
|
|
UHoldToInitCombat();
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
UUserWidget* InitCombatWidget;
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
TSubclassOf<UUserWidget> InitCombatWidgetClass;
|
|
|
|
|
|
2023-01-31 03:13:17 +00:00
|
|
|
|
UPROPERTY()
|
2023-01-31 01:48:35 +00:00
|
|
|
|
UNiagaraSystem* GunEffect;
|
|
|
|
|
|
2023-04-26 01:10:01 +00:00
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
|
float ReloadTime = 1.0f;
|
|
|
|
|
|
2023-04-26 02:22:13 +00:00
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
|
void OnClickDown();
|
|
|
|
|
|
2022-11-29 00:23:15 +00:00
|
|
|
|
protected:
|
|
|
|
|
// Called when the game starts
|
|
|
|
|
virtual void BeginPlay() override;
|
2023-04-26 04:51:07 +00:00
|
|
|
|
UPROPERTY()
|
|
|
|
|
UBlackboardComponent* EnemyBlackboard;
|
2022-11-29 00:23:15 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// Called every frame
|
|
|
|
|
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
|
|
|
|
|
|
|
|
|
private:
|
2023-04-26 01:10:01 +00:00
|
|
|
|
bool bClickDown = false;
|
|
|
|
|
float ReloadTimer = 0.0f;
|
|
|
|
|
|
2022-11-29 00:23:15 +00:00
|
|
|
|
UFUNCTION()
|
|
|
|
|
AActor* LookingAtEnemy() const;
|
|
|
|
|
AActor* TargetEnemy = nullptr;
|
2023-04-26 01:10:01 +00:00
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
URadialSlider* ReloadSlider;
|
2022-11-29 00:23:15 +00:00
|
|
|
|
};
|