diff --git a/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset b/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset index a75b9999..53788569 100644 Binary files a/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset and b/Content/CombatSystem/Blueprints/BP_CombatCharacter.uasset differ diff --git a/Content/ParagonKwang/Animations/ABP_Kwang.uasset b/Content/ParagonKwang/Animations/ABP_Kwang.uasset index 41805698..c630aed8 100644 Binary files a/Content/ParagonKwang/Animations/ABP_Kwang.uasset and b/Content/ParagonKwang/Animations/ABP_Kwang.uasset differ diff --git a/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset b/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset index 825c085e..d3da2f5e 100644 Binary files a/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset and b/Content/ParagonKwang/Characters/Heroes/Kwang/Meshes/Kwang_Skeleton.uasset differ diff --git a/Source/D1/AI/BossEnemy.cpp b/Source/D1/AI/BossEnemy.cpp index 6dae1b2f..75d552af 100644 --- a/Source/D1/AI/BossEnemy.cpp +++ b/Source/D1/AI/BossEnemy.cpp @@ -46,7 +46,7 @@ ABossEnemy::ABossEnemy() //Setting CombatComponent //Setting others is Parents - CombatComponent->OnCombatToggled.BindUObject(this, &ABossEnemy::OnCombatToggled); + CombatComponent->OnCombatToggled.AddUObject(this, &ABossEnemy::OnCombatToggled); } void ABossEnemy::BeginPlay() diff --git a/Source/D1/AI/CombatAIController.cpp b/Source/D1/AI/CombatAIController.cpp index 0ad601fe..0ecd75a5 100644 --- a/Source/D1/AI/CombatAIController.cpp +++ b/Source/D1/AI/CombatAIController.cpp @@ -45,7 +45,7 @@ void ACombatAIController::OnPossess(APawn* InPawn) MasterAI = AIpawn; UCombatComponent* combatComponent = MasterAI->GetComponentByClass(); - combatComponent->OnCombatToggled.BindUObject(this, &ACombatAIController::OnCombatToggle); + combatComponent->OnCombatToggled.AddUObject(this, &ACombatAIController::OnCombatToggle); RunBehaviorTree(MasterAI->GetBeHaviorTree()); diff --git a/Source/D1/AI/GruntlingEnemy.cpp b/Source/D1/AI/GruntlingEnemy.cpp index 1169983e..9ef06868 100644 --- a/Source/D1/AI/GruntlingEnemy.cpp +++ b/Source/D1/AI/GruntlingEnemy.cpp @@ -44,7 +44,7 @@ AGruntlingEnemy::AGruntlingEnemy() //Setting CombatComponent //Setting others is Parents - CombatComponent->OnCombatToggled.BindUObject(this, &AGruntlingEnemy::OnCombatToggled); + CombatComponent->OnCombatToggled.AddUObject(this, &AGruntlingEnemy::OnCombatToggled); } void AGruntlingEnemy::BeginPlay() diff --git a/Source/D1/AI/HeavyMobEnemy.cpp b/Source/D1/AI/HeavyMobEnemy.cpp index 5f70c8aa..868ebc70 100644 --- a/Source/D1/AI/HeavyMobEnemy.cpp +++ b/Source/D1/AI/HeavyMobEnemy.cpp @@ -44,7 +44,7 @@ AHeavyMobEnemy::AHeavyMobEnemy() //Setting CombatComponent //Setting others is Parents - CombatComponent->OnCombatToggled.BindUObject(this, &AHeavyMobEnemy::OnCombatToggled); + CombatComponent->OnCombatToggled.AddUObject(this, &AHeavyMobEnemy::OnCombatToggled); } void AHeavyMobEnemy::BeginPlay() diff --git a/Source/D1/AI/MobEnemy.cpp b/Source/D1/AI/MobEnemy.cpp index faea9711..2278e8b7 100644 --- a/Source/D1/AI/MobEnemy.cpp +++ b/Source/D1/AI/MobEnemy.cpp @@ -38,7 +38,7 @@ AMobEnemy::AMobEnemy() //Setting CombatComponent //Setting others is Parents - CombatComponent->OnCombatToggled.BindUObject(this, &AMobEnemy::OnCombatToggled); + CombatComponent->OnCombatToggled.AddUObject(this, &AMobEnemy::OnCombatToggled); } void AMobEnemy::BeginPlay() diff --git a/Source/D1/Actor/BaseShield.cpp b/Source/D1/Actor/BaseShield.cpp index 9bd87cb6..4bd49543 100644 --- a/Source/D1/Actor/BaseShield.cpp +++ b/Source/D1/Actor/BaseShield.cpp @@ -14,7 +14,7 @@ void ABaseShield::OnEquipped() if (!owner) return; CombatComponent = owner->GetComponentByClass(); - CombatComponent->OnCombatToggled.BindUObject(this, &ABaseWeapon::ToggleWeaponCombat); + CombatComponent->OnCombatToggled.AddUObject(this, &ABaseWeapon::ToggleWeaponCombat); OwnerStateManager = owner->GetComponentByClass(); diff --git a/Source/D1/Actor/BaseWeapon.cpp b/Source/D1/Actor/BaseWeapon.cpp index eb02a955..0d6cd9b8 100644 --- a/Source/D1/Actor/BaseWeapon.cpp +++ b/Source/D1/Actor/BaseWeapon.cpp @@ -51,11 +51,11 @@ void ABaseWeapon::OnEquipped() if (!owner) return; CombatComponent = owner->GetComponentByClass(); - CombatComponent->OnCombatToggled.BindUObject(this, &ABaseWeapon::ToggleWeaponCombat); + CombatComponent->OnCombatToggled.AddUObject(this, &ABaseWeapon::ToggleWeaponCombat); OwnerStateManager = owner->GetComponentByClass(); - if (CombatComponent->GetCombatEnabled()) //TODO : 방패 착용 후 Toggle Event 시 Weapon의 소켓이 안바뀌는 버그 + if (CombatComponent->GetCombatEnabled()) AttachActor(HandSocketName); else AttachActor(AttachSocketName); diff --git a/Source/D1/Animation/CombatAnimInstance.cpp b/Source/D1/Animation/CombatAnimInstance.cpp index 361031da..ca8edd0b 100644 --- a/Source/D1/Animation/CombatAnimInstance.cpp +++ b/Source/D1/Animation/CombatAnimInstance.cpp @@ -21,8 +21,8 @@ void UCombatAnimInstance::NativeInitializeAnimation() ensure(CombatComponent); if(IsValid(CombatComponent)) { - CombatComponent->OnCombatToggled.BindUObject(this, &UCombatAnimInstance::UpdateCombatEnabled); - CombatComponent->OnBlockingSet.BindUObject(this, &UCombatAnimInstance::OnBlockingSet_Event); + CombatComponent->OnCombatToggled.AddUObject(this, &UCombatAnimInstance::UpdateCombatEnabled); + CombatComponent->OnBlockingSet.AddUObject(this, &UCombatAnimInstance::OnBlockingSet_Event); } } } diff --git a/Source/D1/CombatPlayerCharacter.cpp b/Source/D1/CombatPlayerCharacter.cpp index 96e45207..3fe498dc 100644 --- a/Source/D1/CombatPlayerCharacter.cpp +++ b/Source/D1/CombatPlayerCharacter.cpp @@ -69,7 +69,7 @@ ACombatPlayerCharacter::ACombatPlayerCharacter() // Setting CombatComponent CombatComponent = CreateDefaultSubobject(TEXT("CombatComponent")); - CombatComponent->OnCombatToggled.BindUObject(this, &ACombatPlayerCharacter::CharacterCombatToggled); + CombatComponent->OnCombatToggled.AddUObject(this, &ACombatPlayerCharacter::CharacterCombatToggled); // Setting StateManagerComponent StateManagerComponent = CreateDefaultSubobject(TEXT("StateManagerComponent")); @@ -251,7 +251,8 @@ void ACombatPlayerCharacter::SetupPlayerInputComponent(class UInputComponent* Pl EnhancedInputComponent->BindAction(ToggleLockOnAction, ETriggerEvent::Started, this, &ACombatPlayerCharacter::ToggleLockOn); //Block - EnhancedInputComponent->BindAction(ToggleLockOnAction, ETriggerEvent::Started, this, &ACombatPlayerCharacter::ToggleLockOn); + EnhancedInputComponent->BindAction(BlockAction, ETriggerEvent::Triggered, this, &ACombatPlayerCharacter::Blocking); + EnhancedInputComponent->BindAction(BlockAction, ETriggerEvent::Completed, this, &ACombatPlayerCharacter::StopBlocking); } } @@ -545,10 +546,11 @@ void ACombatPlayerCharacter::Blocking(const FInputActionValue& Value) { CombatComponent->SetBlockingState(true); } - else - { - CombatComponent->SetBlockingState(false); - } +} + +void ACombatPlayerCharacter::StopBlocking(const FInputActionValue& Value) +{ + CombatComponent->SetBlockingState(false); } void ACombatPlayerCharacter::CharacterStateBegin(FGameplayTag CharState) diff --git a/Source/D1/CombatPlayerCharacter.h b/Source/D1/CombatPlayerCharacter.h index 9356a433..6aba6ee8 100644 --- a/Source/D1/CombatPlayerCharacter.h +++ b/Source/D1/CombatPlayerCharacter.h @@ -151,6 +151,7 @@ protected: void StopSprint(const FInputActionValue& Value); void ToggleLockOn(const FInputActionValue& Value); void Blocking(const FInputActionValue& Value); + void StopBlocking(const FInputActionValue& Value); private://Delegate void CharacterStateBegin(FGameplayTag CharState); diff --git a/Source/D1/Components/CombatComponent.cpp b/Source/D1/Components/CombatComponent.cpp index ce3d7243..5330513d 100644 --- a/Source/D1/Components/CombatComponent.cpp +++ b/Source/D1/Components/CombatComponent.cpp @@ -19,7 +19,7 @@ void UCombatComponent::SetCombatEnabled(bool bInputCombat) { bCombatEnabled = bInputCombat; - OnCombatToggled.Execute(bInputCombat); + OnCombatToggled.Broadcast(bInputCombat); // ACharacter* character = Cast(GetOwner()); // if (character) @@ -57,7 +57,7 @@ void UCombatComponent::SetBlockingState(bool enableBlocking) if(enableBlocking != bIsBlocking) { bIsBlocking = enableBlocking; - OnBlockingSet.Execute(bIsBlocking); + OnBlockingSet.Broadcast(bIsBlocking); } } diff --git a/Source/D1/Components/CombatComponent.h b/Source/D1/Components/CombatComponent.h index 7f6f884a..b17de27c 100644 --- a/Source/D1/Components/CombatComponent.h +++ b/Source/D1/Components/CombatComponent.h @@ -6,8 +6,8 @@ #include "Components/ActorComponent.h" #include "CombatComponent.generated.h" -DECLARE_DELEGATE_OneParam(FOnCombatToggled, bool); -DECLARE_DELEGATE_OneParam(FOnBlockingSet, bool); +DECLARE_MULTICAST_DELEGATE_OneParam(FOnCombatToggled, bool); +DECLARE_MULTICAST_DELEGATE_OneParam(FOnBlockingSet, bool); class ABaseWeapon; UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )