[박치영] Skeletal Enemy 작업
parent
9da6cabc98
commit
ff4c626d33
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -109,6 +109,9 @@ AMasterAI::AMasterAI()
|
|||
|
||||
//Setting Timeline
|
||||
RotateToTargetTimeLineComponent = CreateDefaultSubobject<UTimelineComponent>(TEXT("RotateToTargetTimeLineComponent"));
|
||||
static ConstructorHelpers::FObjectFinder<UCurveFloat> UCurveObj(TEXT("/Game/CombatSystem/Blueprints/Timeline/RotateToTargetCurve.RotateToTargetCurve"));
|
||||
if(UCurveObj.Succeeded())
|
||||
CurveFloatTimeline = UCurveObj.Object;
|
||||
}
|
||||
|
||||
void AMasterAI::BeginPlay()
|
||||
|
@ -305,6 +308,11 @@ void AMasterAI::OnTargetSet(AActor* NewTarget)
|
|||
TargetActor = NewTarget;
|
||||
}
|
||||
|
||||
UPrimitiveComponent* AMasterAI::GetWeaponMesh()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AMasterAI::SetMovementSpeedMode(EMovementSpeedMode NewSpeedMode)
|
||||
{
|
||||
if (NewSpeedMode == MovementSpeedMode)
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override { TagContainer = OwnedGameplayTags; }
|
||||
public:
|
||||
virtual void OnTargetSet(AActor* NewTarget);
|
||||
virtual UPrimitiveComponent* GetWeaponMesh();
|
||||
public:
|
||||
void SetMovementSpeedMode(EMovementSpeedMode NewSpeedMode);
|
||||
FORCEINLINE EMovementSpeedMode GetMovementSpeedMode() const { return MovementSpeedMode; }
|
||||
|
|
|
@ -32,12 +32,6 @@ AMobEnemy::AMobEnemy()
|
|||
HealthBarComponent->SetVisibility(false);
|
||||
}
|
||||
|
||||
//Setting WeaponMeshComponent
|
||||
WeaponMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("WeaponMeshComponent"));
|
||||
WeaponMeshComponent->SetRelativeLocationAndRotation(FVector(0.f, 0.f, 0.f), FRotator(0.f, 0.f, 0.f));
|
||||
WeaponMeshComponent->SetupAttachment(GetMesh(), AttachSocketName);
|
||||
WeaponMeshComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
|
||||
//Setting MainWeaponCollisionComponent
|
||||
//Setting others is Parents
|
||||
MainWeaponCollisionComponent->OnHitDelegate.BindUObject(this, &AMobEnemy::OnHit);
|
||||
|
@ -51,11 +45,9 @@ void AMobEnemy::BeginPlay()
|
|||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
MainWeaponCollisionComponent->SetCollisionMeshComponent(WeaponMeshComponent);
|
||||
MainWeaponCollisionComponent->SetCollisionMeshComponent(GetWeaponMesh());
|
||||
MainWeaponCollisionComponent->AddActorToIgnore(this);
|
||||
|
||||
if(APlayerController* playerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
||||
{
|
||||
UUI_HealthBar* HealthBarRef = Cast<UUI_HealthBar>(HealthBarComponent->GetWidget());
|
||||
if (HealthBarRef) //ExposeOnSpawn 대용으로 사용
|
||||
{
|
||||
|
@ -63,7 +55,6 @@ void AMobEnemy::BeginPlay()
|
|||
HealthBarComponent->SetWidget(HealthBarRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AMobEnemy::OnTargeted(bool bIsTargeted)
|
||||
{
|
||||
|
@ -89,7 +80,7 @@ void AMobEnemy::OnCombatToggled(bool IsCombatEnabled)
|
|||
else
|
||||
SocketName = AttachSocketName;
|
||||
FAttachmentTransformRules rules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, true);
|
||||
WeaponMeshComponent->AttachToComponent(GetMesh(), rules, SocketName);
|
||||
GetWeaponMesh()->AttachToComponent(GetMesh(), rules, SocketName);
|
||||
}
|
||||
|
||||
void AMobEnemy::PerformDeath()
|
||||
|
@ -101,6 +92,6 @@ void AMobEnemy::PerformDeath()
|
|||
|
||||
void AMobEnemy::SimulateWeaponPhysics()
|
||||
{
|
||||
WeaponMeshComponent->SetCollisionProfileName(TEXT("PhysicsActor"), true);
|
||||
WeaponMeshComponent->SetSimulatePhysics(true);
|
||||
GetWeaponMesh()->SetCollisionProfileName(TEXT("PhysicsActor"), true);
|
||||
GetWeaponMesh()->SetSimulatePhysics(true);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@ public:
|
|||
private:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="UI", meta=(AllowPrivateAccess="true"))
|
||||
TObjectPtr<class UWidgetComponent> HealthBarComponent;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Component", meta=(AllowPrivateAccess="true"))
|
||||
TObjectPtr<class UStaticMeshComponent> WeaponMeshComponent;
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
@ -38,7 +36,7 @@ public:
|
|||
virtual void PerformDeath() override;
|
||||
void SimulateWeaponPhysics();
|
||||
|
||||
private:
|
||||
protected:
|
||||
UPROPERTY(EditAnywhere, Blueprintable, Category="Initialization", meta=(AllowPrivateAccess="true"))
|
||||
FName AttachSocketName;
|
||||
UPROPERTY(EditAnywhere, Blueprintable, Category="Initialization", meta=(AllowPrivateAccess="true"))
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "AI/SkeletonEnemy.h"
|
||||
|
||||
ASkeletonEnemy::ASkeletonEnemy()
|
||||
{
|
||||
//Setting WeaponMeshComponent
|
||||
WeaponMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("WeaponMeshComponent"));
|
||||
WeaponMeshComponent->SetRelativeLocationAndRotation(FVector(0.f, 0.f, 0.f), FRotator(0.f, 0.f, 0.f));
|
||||
WeaponMeshComponent->SetupAttachment(GetMesh(), AttachSocketName);
|
||||
WeaponMeshComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
}
|
||||
|
||||
UPrimitiveComponent* ASkeletonEnemy::GetWeaponMesh()
|
||||
{
|
||||
return WeaponMeshComponent;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "AI/MobEnemy.h"
|
||||
#include "SkeletonEnemy.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class D1_API ASkeletonEnemy : public AMobEnemy
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
ASkeletonEnemy();
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Component", meta=(AllowPrivateAccess="true"))
|
||||
TObjectPtr<USkeletalMeshComponent> WeaponMeshComponent;
|
||||
|
||||
protected:
|
||||
virtual UPrimitiveComponent* GetWeaponMesh() override;
|
||||
};
|
Loading…
Reference in New Issue