Professional Documents
Culture Documents
Enemy Controller Base
Enemy Controller Base
#pragma once
#include "CoreMinimal.h"
#include "Enemies/EnemyControllerBase.h"
#include "MeleeEnemyController.generated.h"
UCLASS()
class AUREISTAR_API AMeleeEnemyController : public AEnemyControllerBase
{
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "EnemyCtrl") class
AMeleeEnemyPawn* MeleePawn;
private:
float curChargeCD = 0;
public:
UFUNCTION(BlueprintCallable) void TryAttack(FVector playerLocation, float
DeltaTime);
protected:
virtual void OnPossess(APawn* InPawn) override;
private:
bool CanTraceToPlayer(FVector playerLocation);
bool TraceToPlayer(FVector& offset, FVector& BaseEnd);
bool TryStartCharge(FVector playerLocation, float DeltaTime);
};