Compare commits
No commits in common. "fc7095fd756068d96cbaf249d353875a6187863a" and "6bccd097bbc7ed7c165931548a7d7f43015b55ca" have entirely different histories.
fc7095fd75
...
6bccd097bb
BIN
Content/Input/Actions/IA_Crouch.uasset (Stored with Git LFS)
BIN
Content/Input/Actions/IA_Crouch.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Input/InputMappingContext.uasset (Stored with Git LFS)
BIN
Content/Input/InputMappingContext.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Player/PlayerCharacter.uasset (Stored with Git LFS)
BIN
Content/Player/PlayerCharacter.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -5,11 +5,6 @@
|
||||||
|
|
||||||
#include <GameFramework/Character.h>
|
#include <GameFramework/Character.h>
|
||||||
|
|
||||||
UNakatomiCMC::UNakatomiCMC(): Safe_bWantsToSprint(false)
|
|
||||||
{
|
|
||||||
NavAgentProps.bCanCrouch = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Checks if we can combine the NewMove with the current move to save on data.
|
// Checks if we can combine the NewMove with the current move to save on data.
|
||||||
// If all the data in a saved move is identical, if true, we cam tell the server to run the existing move instead.
|
// If all the data in a saved move is identical, if true, we cam tell the server to run the existing move instead.
|
||||||
bool UNakatomiCMC::FSavedMove_Nakatomi::CanCombineWith(const FSavedMovePtr& NewMove, ACharacter* InCharacter,
|
bool UNakatomiCMC::FSavedMove_Nakatomi::CanCombineWith(const FSavedMovePtr& NewMove, ACharacter* InCharacter,
|
||||||
|
@ -88,6 +83,10 @@ FNetworkPredictionData_Client* UNakatomiCMC::GetPredictionData_Client() const
|
||||||
return ClientPredictionData;
|
return ClientPredictionData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UNakatomiCMC::UNakatomiCMC(): Safe_bWantsToSprint(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void UNakatomiCMC::UpdateFromCompressedFlags(uint8 Flags)
|
void UNakatomiCMC::UpdateFromCompressedFlags(uint8 Flags)
|
||||||
{
|
{
|
||||||
Super::UpdateFromCompressedFlags(Flags);
|
Super::UpdateFromCompressedFlags(Flags);
|
||||||
|
@ -121,13 +120,3 @@ void UNakatomiCMC::DisableSprint()
|
||||||
{
|
{
|
||||||
Safe_bWantsToSprint = false;
|
Safe_bWantsToSprint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UNakatomiCMC::EnableCrouch()
|
|
||||||
{
|
|
||||||
bWantsToCrouch = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UNakatomiCMC::DisableCrouch()
|
|
||||||
{
|
|
||||||
bWantsToCrouch = false;
|
|
||||||
}
|
|
||||||
|
|
|
@ -57,10 +57,4 @@ public:
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void DisableSprint();
|
void DisableSprint();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
|
||||||
void EnableCrouch();
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
|
||||||
void DisableCrouch();
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,8 +25,6 @@ void ANakatomiCharacter::BeginPlay()
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
SetInventoryToDefault();
|
SetInventoryToDefault();
|
||||||
|
|
||||||
NakatomiCMC = Cast<UNakatomiCMC>(GetCharacterMovement());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame
|
// Called every frame
|
||||||
|
@ -239,11 +237,6 @@ void ANakatomiCharacter::PushThrowableToInventory(TSubclassOf<AThrowable> Throwa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UNakatomiCMC* ANakatomiCharacter::GetCharacterMovementComponent()
|
|
||||||
{
|
|
||||||
return NakatomiCMC;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ANakatomiCharacter::CalculateHits(TArray<FHitResult>* hits)
|
void ANakatomiCharacter::CalculateHits(TArray<FHitResult>* hits)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,8 +104,6 @@ public:
|
||||||
|
|
||||||
void PushThrowableToInventory(TSubclassOf<AThrowable> Throwable);
|
void PushThrowableToInventory(TSubclassOf<AThrowable> Throwable);
|
||||||
|
|
||||||
UNakatomiCMC* GetCharacterMovementComponent();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void CalculateHits(TArray<FHitResult>* hits);
|
virtual void CalculateHits(TArray<FHitResult>* hits);
|
||||||
|
|
||||||
|
|
|
@ -187,12 +187,6 @@ void APlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCom
|
||||||
{
|
{
|
||||||
Input->BindAction(PauseAction, ETriggerEvent::Completed, this, &APlayerCharacter::PauseCallback);
|
Input->BindAction(PauseAction, ETriggerEvent::Completed, this, &APlayerCharacter::PauseCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CrouchAction)
|
|
||||||
{
|
|
||||||
Input->BindAction(CrouchAction, ETriggerEvent::Started, this, &APlayerCharacter::BeginCrouchCallback);
|
|
||||||
Input->BindAction(CrouchAction, ETriggerEvent::Completed, this, &APlayerCharacter::EndCrouchCallback);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,21 +268,17 @@ void APlayerCharacter::QuitCallback(const FInputActionInstance& Instance)
|
||||||
|
|
||||||
void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance)
|
void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance)
|
||||||
{
|
{
|
||||||
UNakatomiCMC* cmc = GetCharacterMovementComponent();
|
if (NakatomiCMC)
|
||||||
|
|
||||||
if (cmc)
|
|
||||||
{
|
{
|
||||||
cmc->EnableSprint();
|
NakatomiCMC->EnableSprint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance)
|
void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance)
|
||||||
{
|
{
|
||||||
UNakatomiCMC* cmc = GetCharacterMovementComponent();
|
if (NakatomiCMC)
|
||||||
|
|
||||||
if (cmc)
|
|
||||||
{
|
{
|
||||||
cmc->DisableSprint();
|
NakatomiCMC->DisableSprint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,26 +536,6 @@ void APlayerCharacter::PauseCallback(const FInputActionInstance& Instance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCharacter::BeginCrouchCallback(const FInputActionInstance& Instance)
|
|
||||||
{
|
|
||||||
UNakatomiCMC* cmc = GetCharacterMovementComponent();
|
|
||||||
|
|
||||||
if (cmc)
|
|
||||||
{
|
|
||||||
cmc->EnableCrouch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void APlayerCharacter::EndCrouchCallback(const FInputActionInstance& Instance)
|
|
||||||
{
|
|
||||||
UNakatomiCMC* cmc = GetCharacterMovementComponent();
|
|
||||||
|
|
||||||
if (cmc)
|
|
||||||
{
|
|
||||||
cmc->DisableCrouch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void APlayerCharacter::OnFire()
|
void APlayerCharacter::OnFire()
|
||||||
{
|
{
|
||||||
if (!IsFiring || CurrentWeapon->GetAmmoCount() == 0)
|
if (!IsFiring || CurrentWeapon->GetAmmoCount() == 0)
|
||||||
|
|
|
@ -65,9 +65,6 @@ public:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
UInputAction* AimDownSightsAction;
|
UInputAction* AimDownSightsAction;
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
||||||
UInputAction* CrouchAction;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
TSoftObjectPtr<UInputMappingContext> InputMappingContext;
|
TSoftObjectPtr<UInputMappingContext> InputMappingContext;
|
||||||
|
|
||||||
|
@ -178,10 +175,6 @@ public:
|
||||||
|
|
||||||
void PauseCallback(const FInputActionInstance& Instance);
|
void PauseCallback(const FInputActionInstance& Instance);
|
||||||
|
|
||||||
void BeginCrouchCallback(const FInputActionInstance& Instance);
|
|
||||||
|
|
||||||
void EndCrouchCallback(const FInputActionInstance& Instance);
|
|
||||||
|
|
||||||
virtual void OnFire() override;
|
virtual void OnFire() override;
|
||||||
|
|
||||||
void WeaponCooldownHandler();
|
void WeaponCooldownHandler();
|
||||||
|
|
Loading…
Reference in New Issue