Compare commits
No commits in common. "5e0433905f236b1f425760bbee94486ea0f4cec8" and "ba0243bd6516c12e50376bebb20a4bd8ec80d6dd" have entirely different histories.
5e0433905f
...
ba0243bd65
|
@ -8,8 +8,6 @@
|
|||
#include "BehaviorTree/BehaviorTree.h"
|
||||
#include "BehaviorTree/BlackboardComponent.h"
|
||||
#include "BehaviorTree/BlackboardData.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "UI/EnemyHealthbarUserWidget.h"
|
||||
|
||||
#define COLLISION_WEAPON ECC_GameTraceChannel1
|
||||
|
@ -80,23 +78,6 @@ void AEnemyCharacter::BeginPlay()
|
|||
}
|
||||
}
|
||||
|
||||
void AEnemyCharacter::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
if (PlayerCharacter && HealthbarWidgetComponent->GetWidget())
|
||||
{
|
||||
FVector ActorLocation = GetActorLocation();
|
||||
|
||||
UCameraComponent* PlayerCamera = PlayerCharacter->GetCameraComponent();
|
||||
FVector PlayerLocation = PlayerCamera->GetComponentTransform().GetLocation();
|
||||
|
||||
FRotator rotation = UKismetMathLibrary::FindLookAtRotation(ActorLocation, PlayerLocation);
|
||||
HealthbarWidgetComponent->SetWorldRotation(rotation);
|
||||
}
|
||||
}
|
||||
|
||||
void AEnemyCharacter::PlayOnFireAnimations()
|
||||
{
|
||||
Super::PlayOnFireAnimations();
|
||||
|
|
|
@ -53,9 +53,6 @@ public:
|
|||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
private:
|
||||
virtual void PlayOnFireAnimations() override;
|
||||
|
||||
|
|
|
@ -826,8 +826,3 @@ void APlayerCharacter::SetIsThrowing(bool bIsThrowing)
|
|||
{
|
||||
IsThrowing = bIsThrowing;
|
||||
}
|
||||
|
||||
UCameraComponent* APlayerCharacter::GetCameraComponent()
|
||||
{
|
||||
return CameraComponent;
|
||||
}
|
||||
|
|
|
@ -242,8 +242,6 @@ public:
|
|||
UFUNCTION(BlueprintCallable)
|
||||
void SetIsThrowing(bool bIsThrowing);
|
||||
|
||||
UCameraComponent* GetCameraComponent();
|
||||
|
||||
protected:
|
||||
virtual void CalculateHits(TArray<FHitResult>* hits, FVector* dir) override;
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ void UEnemyHealthbarUserWidget::BindOwner(AEnemyCharacter* NewOwner)
|
|||
{
|
||||
auto healthComponent = Owner->GetHealthComponent();
|
||||
healthComponent->OnDamaged.BindUFunction(this, "UpdateHealthbar");
|
||||
UpdateHealthbar();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue