183 - Frame Package
This commit is contained in:
parent
739f9f325b
commit
a52dc24cdf
|
@ -6,6 +6,7 @@
|
||||||
#include "Blaster/Blaster.h"
|
#include "Blaster/Blaster.h"
|
||||||
#include "Blaster/Components/BuffComponent.h"
|
#include "Blaster/Components/BuffComponent.h"
|
||||||
#include "Blaster/Components/CombatComponent.h"
|
#include "Blaster/Components/CombatComponent.h"
|
||||||
|
#include "Blaster/Components/LagCompensationComponent.h"
|
||||||
#include "Blaster/GameMode/BlasterGameMode.h"
|
#include "Blaster/GameMode/BlasterGameMode.h"
|
||||||
#include "Blaster/PlayerController/BlasterPlayerController.h"
|
#include "Blaster/PlayerController/BlasterPlayerController.h"
|
||||||
#include "Blaster/PlayerState/BlasterPlayerState.h"
|
#include "Blaster/PlayerState/BlasterPlayerState.h"
|
||||||
|
@ -45,6 +46,8 @@ ABlasterCharacter::ABlasterCharacter()
|
||||||
Combat = CreateDefaultSubobject<UCombatComponent>(TEXT("CombatComponent"));
|
Combat = CreateDefaultSubobject<UCombatComponent>(TEXT("CombatComponent"));
|
||||||
Combat->SetIsReplicated(true);
|
Combat->SetIsReplicated(true);
|
||||||
|
|
||||||
|
LagCompensation = CreateDefaultSubobject<ULagCompensationComponent>(TEXT("LagCompensation"));
|
||||||
|
|
||||||
Buff = CreateDefaultSubobject<UBuffComponent>(TEXT("BuffComponent"));
|
Buff = CreateDefaultSubobject<UBuffComponent>(TEXT("BuffComponent"));
|
||||||
Buff->SetIsReplicated(true);
|
Buff->SetIsReplicated(true);
|
||||||
|
|
||||||
|
@ -336,6 +339,14 @@ void ABlasterCharacter::PostInitializeComponents()
|
||||||
Buff->SetInitialSpeeds(GetCharacterMovement()->MaxWalkSpeed, GetCharacterMovement()->MaxWalkSpeedCrouched);
|
Buff->SetInitialSpeeds(GetCharacterMovement()->MaxWalkSpeed, GetCharacterMovement()->MaxWalkSpeedCrouched);
|
||||||
Buff->SetInitialJumpVelocity(GetCharacterMovement()->JumpZVelocity);
|
Buff->SetInitialJumpVelocity(GetCharacterMovement()->JumpZVelocity);
|
||||||
}
|
}
|
||||||
|
if (LagCompensation)
|
||||||
|
{
|
||||||
|
LagCompensation->Character = this;
|
||||||
|
if (Controller)
|
||||||
|
{
|
||||||
|
LagCompensation->Controller = Cast<ABlasterPlayerController>(Controller);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ABlasterCharacter::PlayFireMontage(bool bAiming)
|
void ABlasterCharacter::PlayFireMontage(bool bAiming)
|
||||||
|
|
|
@ -150,12 +150,17 @@ private:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);
|
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);
|
||||||
|
|
||||||
|
// Blaster Components
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
||||||
class UCombatComponent* Combat;
|
class UCombatComponent* Combat;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere)
|
UPROPERTY(VisibleAnywhere)
|
||||||
class UBuffComponent* Buff;
|
class UBuffComponent* Buff;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere)
|
||||||
|
class ULagCompensationComponent* LagCompensation;
|
||||||
|
|
||||||
UFUNCTION(Server, Reliable)
|
UFUNCTION(Server, Reliable)
|
||||||
void ServerEquipButtonPressed();
|
void ServerEquipButtonPressed();
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,35 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "Blaster/Character/BlasterCharacter.h"
|
||||||
#include "Components/ActorComponent.h"
|
#include "Components/ActorComponent.h"
|
||||||
#include "LagCompensationComponent.generated.h"
|
#include "LagCompensationComponent.generated.h"
|
||||||
|
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct FBoxInformation
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
FVector Location;
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
FRotator Rotation;
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
FVector BoxExtend;
|
||||||
|
};
|
||||||
|
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct FFramePackage
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
float Time;
|
||||||
|
|
||||||
|
TMap<FName, FBoxInformation> HitBoxInfo;
|
||||||
|
};
|
||||||
|
|
||||||
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
||||||
class BLASTER_API ULagCompensationComponent : public UActorComponent
|
class BLASTER_API ULagCompensationComponent : public UActorComponent
|
||||||
|
@ -14,12 +40,19 @@ class BLASTER_API ULagCompensationComponent : public UActorComponent
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ULagCompensationComponent();
|
ULagCompensationComponent();
|
||||||
|
friend ABlasterCharacter;
|
||||||
|
|
||||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
public:
|
private:
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
ABlasterCharacter* Character;
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
ABlasterPlayerController* Controller;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue