diff --git a/Content/Character/Lb/Animation/ABP_Lb.uasset b/Content/Character/Lb/Animation/ABP_Lb.uasset index 7f8c503..5a81b45 100644 --- a/Content/Character/Lb/Animation/ABP_Lb.uasset +++ b/Content/Character/Lb/Animation/ABP_Lb.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60a91a0ac26b8c4b06b74e612bbf7601fd7ed5d0a3a0fe32db06ba96a33c4da9 -size 313020 +oid sha256:55f905bcd305f8c23ee484fa11fcae581e830cb01132382ee18d7aba8035c2b0 +size 337395 diff --git a/Content/Maps/DevMap.umap b/Content/Maps/DevMap.umap index fdfef24..8f15050 100644 --- a/Content/Maps/DevMap.umap +++ b/Content/Maps/DevMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a39f01744e181c37a957d0135e6ca1682f3ee37c198524c096b26f66a57a37e7 +oid sha256:1e54e50e895cbaf9d2d2520224d0026554f3d36beb6e9cfa534a86d1aaca3cf9 size 115131 diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp b/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp index 3f71e35..b7c32a1 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp +++ b/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp @@ -384,33 +384,7 @@ void ADefaultPlayerController::Move() if (HitObject != nullptr) { - float MinDistance = 100000.0f; // ÃÖ¼Ò °Å¸® - - FVector Destination = HitObject->GetActorLocation(); // HitObjectÀÇ À§Ä¡¸¦ ¸ñÀûÁö·Î ¼³Á¤ - - if (FVector::Dist(Destination, GetPawn()->GetActorLocation()) <= MinDistance) - { - FVector Location = GetPawn()->GetActorLocation(); - Location.Z = 0; - - Server_StopMove(); - Multicast_StopMove(); - - Multicast_SetRotation(GetMouseHitLocation()); - Server_SetRotation(GetMouseHitLocation()); - - GetPlayerState()->SetState(ECharacterState::Attack); - GetPlayerState()->SetAttackType(CooldownType::Attack); - } - else - { - GetPlayerState()->SetState(ECharacterState::Moving); - SimpleMoveToLocation(this, Destination); - this->MoveToLocation(Destination); - } - - - + Attack(HitObject); } else { @@ -590,11 +564,36 @@ void ADefaultPlayerController::OnMoveCompleted(FAIRequestID RequestID, const FPa GetPlayerState()->SetState(ECharacterState::Idle); } -void ADefaultPlayerController::Attack() +void ADefaultPlayerController::Attack(ACharacter* HitObject) { - UE_LOG(LogTemp, Warning, TEXT("Attack")); - GetPlayerState()->SetState(ECharacterState::Attack); - GetPlayerState()->SetAttackType(CooldownType::Attack); + //¹Ýº¹¹®À¸·Î ¸¸µé¾î »ç¿ëÇϱâ + float MinDistance = 1000.0f; // ÃÖ¼Ò °Å¸®(Àӽà : ÃßÈÄ¿¡ ij¸¯ÅÍ »çÁ¤°Å¸® ¹Þ¾Æ¿Ã°Í) + + FVector Destination = HitObject->GetActorLocation(); // HitObjectÀÇ À§Ä¡¸¦ ¸ñÀûÁö·Î ¼³Á¤ + + if (FVector::Dist(Destination, GetPawn()->GetActorLocation()) <= MinDistance) + { + FVector Location = GetPawn()->GetActorLocation(); + Location.Z = 0; + + Server_StopMove(); + Multicast_StopMove(); + + Multicast_SetRotation(GetMouseHitLocation()); + Server_SetRotation(GetMouseHitLocation()); + + UE_LOG(LogTemp, Warning, TEXT("Attack")); + GetPlayerState()->SetState(ECharacterState::Attack); + GetPlayerState()->SetAttackType(CooldownType::Attack); + } + else + { + GetPlayerState()->SetState(ECharacterState::Moving); + SimpleMoveToLocation(this, Destination); + this->MoveToLocation(Destination); + } + + } void ADefaultPlayerController::MoveToLocation_Implementation(FVector Location) diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerController.h b/Source/Promether/PlayerGeneric/DefaultPlayerController.h index 2c90b72..166d56d 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerController.h +++ b/Source/Promether/PlayerGeneric/DefaultPlayerController.h @@ -64,7 +64,9 @@ public: void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult &MovementResult); - void Attack(); + + + void Attack(ACharacter* HitObject); UPROPERTY(BlueprintReadWrite) float MouseClickInterval;