Files
FirstPersonDemo/Source/FirstPersonDemo/Surviver_FPS/Battle/EnemyBase.h

48 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Copyright Majowaveon Games. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "DamageableInterface.h"
#include "GameFramework/Pawn.h"
#include "EnemyBase.generated.h"
class UHealthComponent;
/**
* @class AEnemyBase
* @brief 敌人基类,实现了可受伤害接口。
* @ingroup Battle
*/
UCLASS()
class FIRSTPERSONDEMO_API AEnemyBase : public APawn, public IDamageableInterface {
GENERATED_BODY()
public:
/**
* @brief 构造函数设置Pawn的默认属性。
*/
AEnemyBase();
protected:
/**
* @brief 管理敌人生命值的组件。
*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
UHealthComponent* HealthComponent;
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
/**
* @brief 接收伤害的接口实现。
* @param DamageAmount 伤害量。
* @param InstigatorActor 造成伤害的Actor。
*/
virtual void ReceiveDamage(float DamageAmount, AActor* InstigatorActor) override;
};