기본 공격 알고리즘 설계중
This commit is contained in:
BIN
Content/Character/Lb/Animation/Treasure_Attack1_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/Animation/Treasure_Attack1_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/BP_Lb.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/BP_Lb.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/InputActions/InputMappingContext.uasset
(Stored with Git LFS)
BIN
Content/InputActions/InputMappingContext.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/InputActions/ObjectSelect.uasset
(Stored with Git LFS)
BIN
Content/InputActions/ObjectSelect.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Maps/DevMap.umap
(Stored with Git LFS)
BIN
Content/Maps/DevMap.umap
(Stored with Git LFS)
Binary file not shown.
BIN
Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
BIN
Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
(Stored with Git LFS)
BIN
Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
(Stored with Git LFS)
Binary file not shown.
@@ -371,15 +371,63 @@ void ADefaultPlayerController::ObjectSelect()
|
|||||||
SetACharacterOutlineColor(HitObject, true);
|
SetACharacterOutlineColor(HitObject, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ADefaultPlayerController::Move()
|
void ADefaultPlayerController::Move()
|
||||||
{
|
{
|
||||||
FVector Destination = GetMouseHitLocation();
|
FHitResult HitResult;
|
||||||
|
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
|
||||||
|
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_WorldStatic));
|
||||||
|
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_Pawn));
|
||||||
|
|
||||||
|
GetHitResultUnderCursorForObjects(ObjectTypes, true, HitResult);
|
||||||
|
ACharacter* HitObject = Cast<ACharacter>(HitResult.GetActor());
|
||||||
|
|
||||||
|
if (HitObject != nullptr)
|
||||||
|
{
|
||||||
|
float MinDistance = 100000.0f; // <20>ּ<EFBFBD> <20>Ÿ<EFBFBD>
|
||||||
|
|
||||||
|
FVector Destination = HitObject->GetActorLocation(); // HitObject<63><74> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
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<ADefaultPlayerState>()->SetState(ECharacterState::Attack);
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->SetAttackType(CooldownType::Attack);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Moving);
|
||||||
|
SimpleMoveToLocation(this, Destination);
|
||||||
|
this->MoveToLocation(Destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HitObject = nullptr;
|
||||||
|
FVector Destination = GetMouseHitLocation();
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Moving);
|
||||||
|
SimpleMoveToLocation(this, Destination);
|
||||||
|
this->MoveToLocation(Destination);
|
||||||
|
}
|
||||||
|
|
||||||
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Moving);
|
|
||||||
SimpleMoveToLocation(this, Destination);
|
|
||||||
this->MoveToLocation(Destination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ADefaultPlayerController::Multicast_SetRotation_Implementation(FVector MouseHitLocation)
|
void ADefaultPlayerController::Multicast_SetRotation_Implementation(FVector MouseHitLocation)
|
||||||
{
|
{
|
||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
|
|||||||
Reference in New Issue
Block a user