Add AI boilerplate
This commit is contained in:
parent
e06b1738c2
commit
3bd49b0b90
|
@ -0,0 +1,18 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "EnemyCharacter.h"
|
||||
|
||||
AEnemyCharacter::AEnemyCharacter(const FObjectInitializer& ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
void AEnemyCharacter::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
}
|
||||
|
||||
void AEnemyCharacter::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "VampireCharacter.h"
|
||||
#include "BehaviorTree/BehaviorTree.h"
|
||||
#include "EnemyCharacter.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class VAMPIRES_API AEnemyCharacter : public AVampireCharacter
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
private:
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Meta = (AllowPrivateAccess = "true"))
|
||||
UBehaviorTree* BehaviourTree;
|
||||
|
||||
public:
|
||||
AEnemyCharacter(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
};
|
|
@ -0,0 +1,31 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "VampireAIController.h"
|
||||
|
||||
AVampireAIController::AVampireAIController(const FObjectInitializer& object_initializer)
|
||||
{
|
||||
}
|
||||
|
||||
void AVampireAIController::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
}
|
||||
|
||||
void AVampireAIController::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
}
|
||||
|
||||
void AVampireAIController::OnPossess(APawn* InPawn)
|
||||
{
|
||||
Super::OnPossess(InPawn);
|
||||
}
|
||||
|
||||
void AVampireAIController::OnDamaged(FDamageInfo info)
|
||||
{
|
||||
}
|
||||
|
||||
void AVampireAIController::OnDeath(FDamageInfo info)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "AIController.h"
|
||||
#include "HealthComponent.h"
|
||||
#include "PlayerCharacter.h"
|
||||
#include "BehaviorTree/BehaviorTreeComponent.h"
|
||||
#include "VampireAIController.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class VAMPIRES_API AVampireAIController : public AAIController
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
private:
|
||||
UBlackboardComponent* Blackboard;
|
||||
|
||||
UBehaviorTreeComponent* BehaviorTree;
|
||||
|
||||
APlayerCharacter* PlayerCharacter;
|
||||
|
||||
public:
|
||||
AVampireAIController(const FObjectInitializer& object_initializer);
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
protected:
|
||||
virtual void OnPossess(APawn* InPawn) override;
|
||||
|
||||
public:
|
||||
UFUNCTION()
|
||||
virtual void OnDamaged(FDamageInfo info);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnDeath(FDamageInfo info);
|
||||
};
|
|
@ -9,7 +9,8 @@
|
|||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default",
|
||||
"AdditionalDependencies": [
|
||||
"Engine"
|
||||
"Engine",
|
||||
"AIModule"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue