[박치영] Grunting Enemy Hit, Death 작업
parent
0e12d099e2
commit
87eba72318
|
@ -146,4 +146,5 @@ ManualIPAddress=
|
|||
+FunctionRedirects=(OldName="/Script/D1.ICombatInterface.PerformCombatAction",NewName="/Script/D1.ICombatInterface.PerformAction")
|
||||
+FunctionRedirects=(OldName="/Script/D1.ICombatInterface.PerformCombatAttack",NewName="/Script/D1.ICombatInterface.PerformAttack")
|
||||
+FunctionRedirects=(OldName="/Script/D1.ICombatInterface.SetIFrames",NewName="/Script/D1.ICombatInterface.SetIFrame")
|
||||
+PropertyRedirects=(OldName="/Script/D1.MasterAI.DeathAnimation",NewName="/Script/D1.MasterAI.DeathAnimations")
|
||||
|
||||
|
|
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.
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.
|
@ -3,11 +3,11 @@
|
|||
|
||||
#include "AI/GruntlingEnemy.h"
|
||||
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "Components/CollisionComponent.h"
|
||||
#include "Components/WidgetComponent.h"
|
||||
#include "Components/CombatComponent.h"
|
||||
#include "Components/WidgetComponent.h"
|
||||
#include "DamageType/AttackDamageType.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "UI/UI_HealthBar.h"
|
||||
|
||||
|
@ -16,8 +16,8 @@ AGruntlingEnemy::AGruntlingEnemy()
|
|||
TargetingWidgetComponent->SetRelativeLocation(FVector(0.f, 0.f, 132.f));
|
||||
|
||||
//Setting SocketName
|
||||
AttachSocketName = TEXT("SwordHipAttachSocket");
|
||||
WeaponHandSocketName = TEXT("RightWeaponSocket");
|
||||
AttachSocketName = TEXT("WeaponSocket");
|
||||
WeaponHandSocketName = TEXT("WeaponSocket");
|
||||
|
||||
//Setting UWidgetComponent
|
||||
HealthBarComponent = CreateDefaultSubobject<UWidgetComponent>(TEXT("HealthBar"));
|
||||
|
@ -97,6 +97,7 @@ void AGruntlingEnemy::PerformDeath()
|
|||
//TODO : 죽었을 때 무기에 Collision이 남아있는 버그 있음
|
||||
Super::PerformDeath();
|
||||
SimulateWeaponPhysics();
|
||||
GetCharacterMovement()->SetMovementMode(MOVE_None);
|
||||
}
|
||||
|
||||
void AGruntlingEnemy::SimulateWeaponPhysics()
|
||||
|
|
|
@ -13,6 +13,7 @@ UCLASS()
|
|||
class D1_API AGruntlingEnemy : public AMasterAI
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AGruntlingEnemy();
|
||||
|
||||
|
|
|
@ -484,6 +484,12 @@ void AMasterAI::RotateToTargetUpdate(float Value)
|
|||
|
||||
void AMasterAI::PerformDeath()
|
||||
{
|
||||
if(!DeathAnimations.IsEmpty())
|
||||
{
|
||||
const int randomIdx = FMath::RandRange(0, DeathAnimations.Num() - 1);
|
||||
PlayAnimMontage(DeathAnimations[randomIdx]);
|
||||
}
|
||||
else
|
||||
EnableRagdoll();
|
||||
|
||||
if(bHitFront) //충돌을 좀 더 그럴싸하게 하기 위해서 피격방향으로 충격
|
||||
|
|
|
@ -150,6 +150,8 @@ private:
|
|||
TObjectPtr<UAnimMontage> KnockdownFrontMontage;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Montage|HitReactions", meta = (AllowPrivateAccess = "true"))
|
||||
TObjectPtr<UAnimMontage> KnockdownBackMontage;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Montage|Death", meta = (AllowPrivateAccess = "true"))
|
||||
TArray<TObjectPtr<UAnimMontage>> DeathAnimations;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Montage|Attacks", meta = (AllowPrivateAccess = "true"))
|
||||
TArray<TObjectPtr<UAnimMontage>> CloseRangeAttackMontage;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Montage|Attacks", meta = (AllowPrivateAccess = "true"))
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "Animation/GruntlingAnimInstance.h"
|
||||
|
||||
#include "GameFramework/Character.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
|
||||
void UGruntlingAnimInstance::NativeInitializeAnimation()
|
||||
{
|
||||
Super::NativeInitializeAnimation();
|
||||
|
||||
GruntlingCharacter = Cast<ACharacter>(GetOwningActor());
|
||||
if(GruntlingCharacter)
|
||||
CharacterMovementComponent = GruntlingCharacter->GetCharacterMovement();
|
||||
}
|
||||
|
||||
void UGruntlingAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
|
||||
{
|
||||
Super::NativeUpdateAnimation(DeltaSeconds);
|
||||
|
||||
if(!IsValid(GruntlingCharacter) || !IsValid(CharacterMovementComponent))
|
||||
return;
|
||||
|
||||
GroundSpeed = CharacterMovementComponent->Velocity.Length();
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Animation/AnimInstance.h"
|
||||
#include "GruntlingAnimInstance.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class D1_API UGruntlingAnimInstance : public UAnimInstance
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
protected:
|
||||
virtual void NativeInitializeAnimation() override;
|
||||
virtual void NativeUpdateAnimation(float DeltaSeconds) override;
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="References", meta=(AllowPrivateAccess="true"))
|
||||
TObjectPtr<ACharacter> GruntlingCharacter;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="References", meta=(AllowPrivateAccess="true"))
|
||||
TObjectPtr<class UCharacterMovementComponent> CharacterMovementComponent;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="EssentialMovementData", meta=(AllowPrivateAccess="true"))
|
||||
float GroundSpeed;
|
||||
};
|
Loading…
Reference in New Issue