Merge branch 'WeaponSystem' into BackupBuild
This commit is contained in:
commit
4219d01ae7
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:652402df45503ab3169e329879f397101d9b5bf17551404301cca7b5b292eb68
|
oid sha256:d593d68d5b9a9fc58b1b7ecc44936b84e361aaa1762ab04c5924e36bfd45bee9
|
||||||
size 62076
|
size 61494
|
||||||
|
@ -174,7 +174,7 @@ void ABaseWeaponClass::Fire()
|
|||||||
traceEnd = traceStart + (GunStartArrow->GetForwardVector() * BulletDistance);
|
traceEnd = traceStart + (GunStartArrow->GetForwardVector() * BulletDistance);
|
||||||
if (GetWorldTimerManager().IsTimerActive(timerHandle)) return;
|
if (GetWorldTimerManager().IsTimerActive(timerHandle)) return;
|
||||||
GetWorld()->LineTraceSingleByChannel(outHit, traceStart, traceEnd, ECC_Visibility, collisionParams);
|
GetWorld()->LineTraceSingleByChannel(outHit, traceStart, traceEnd, ECC_Visibility, collisionParams);
|
||||||
DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Red, false, 5.0f, 0U, 1.5f);
|
DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Black , false, 0.2f, 0U, 0.2f);
|
||||||
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
|
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
|
||||||
currentAmmoCount -= 1;
|
currentAmmoCount -= 1;
|
||||||
GenerateRecoilVector();
|
GenerateRecoilVector();
|
||||||
|
@ -83,9 +83,9 @@ public:
|
|||||||
virtual void Fire();
|
virtual void Fire();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Weapons")
|
UFUNCTION(BlueprintCallable, Category = "Weapons")
|
||||||
void ClickDetectionTimer();
|
virtual void ClickDetectionTimer();
|
||||||
|
|
||||||
void CancelFire();
|
virtual void CancelFire();
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere)
|
UPROPERTY(VisibleAnywhere)
|
||||||
ACharacter* playerInWorld;
|
ACharacter* playerInWorld;
|
||||||
@ -144,9 +144,12 @@ public:
|
|||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
int bulletCountShoot; //Gets how many bullets shot per
|
int bulletCountShoot; //Gets how many bullets shot per
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
protected:
|
||||||
UArrowComponent* GunStartArrow;
|
UArrowComponent* GunStartArrow;
|
||||||
|
bool bStopShooting = false;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
float BulletDistance;
|
float BulletDistance;
|
||||||
@ -157,5 +160,5 @@ private:
|
|||||||
float originalMinMultiplier;
|
float originalMinMultiplier;
|
||||||
|
|
||||||
float currentPitch;
|
float currentPitch;
|
||||||
bool bStopShooting = false;
|
|
||||||
};
|
};
|
||||||
|
@ -30,3 +30,19 @@ void APistolClass::Fire()
|
|||||||
UE_LOG(LogTemp, Display, TEXT("Testing overrides: Pistol has been fired"));
|
UE_LOG(LogTemp, Display, TEXT("Testing overrides: Pistol has been fired"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void APistolClass::ClickDetectionTimer()
|
||||||
|
{
|
||||||
|
Super::ClickDetectionTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void APistolClass::CancelFire()
|
||||||
|
{
|
||||||
|
if (bulletCountShoot <= 0) return;
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("FireCancelled"));
|
||||||
|
bulletCountShoot = 0;
|
||||||
|
GunStartArrow->SetRelativeRotation(FRotator(0));
|
||||||
|
//playerInWorld->GetController()->SetControlRotation(FRotator(0, playerInWorld->GetActorRotation().Yaw, playerInWorld->GetActorRotation().Roll));
|
||||||
|
bStopShooting = true;
|
||||||
|
nullSamples();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -24,4 +24,6 @@ public:
|
|||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
virtual void Fire() override;
|
virtual void Fire() override;
|
||||||
|
virtual void ClickDetectionTimer() override;
|
||||||
|
virtual void CancelFire() override;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user