blaster/Source/Blaster/Character/BlasterCharacter.h

59 lines
1.5 KiB
C
Raw Normal View History

2022-04-28 10:18:21 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "BlasterCharacter.generated.h"
UCLASS()
class BLASTER_API ABlasterCharacter : public ACharacter
{
GENERATED_BODY()
public:
ABlasterCharacter();
2022-04-28 10:41:43 +00:00
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
2022-04-30 10:26:25 +00:00
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
2022-04-30 11:09:28 +00:00
virtual void PostInitializeComponents() override;
2022-04-28 10:18:21 +00:00
protected:
virtual void BeginPlay() override;
2022-04-28 12:39:36 +00:00
void MoveForward(float Value);
void MoveRight(float Value);
void Turn(float Value);
void LookUp(float Value);
2022-04-30 11:09:28 +00:00
void EquipButtonPressed();
2022-04-30 15:10:07 +00:00
void CrouchButtonPressed();
2022-04-30 15:38:03 +00:00
void AimButtonPressed();
void AimButtonReleased();
2022-04-30 11:09:28 +00:00
2022-04-28 10:41:43 +00:00
private:
UPROPERTY(VisibleAnywhere, Category="Camera")
class USpringArmComponent* CameraBoom;
2022-04-28 10:18:21 +00:00
2022-04-28 10:41:43 +00:00
UPROPERTY(VisibleAnywhere, Category="Camera")
class UCameraComponent* FollowCamera;
2022-04-29 21:38:34 +00:00
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UWidgetComponent* OverheadWidget;
2022-04-30 10:26:25 +00:00
UPROPERTY(ReplicatedUsing = OnRep_OverlappingWeapon)
class AWeapon* OverlappingWeapon;
UFUNCTION()
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);
2022-04-30 11:09:28 +00:00
UPROPERTY(VisibleAnywhere)
class UCombatComponent* Combat;
2022-04-30 14:08:00 +00:00
UFUNCTION(Server, Reliable)
void ServerEquipButtonPressed();
2022-04-30 10:26:25 +00:00
public:
void SetOverlappingWeapon(AWeapon* Weapon);
2022-04-30 14:48:34 +00:00
bool IsWeaponEquipped();
2022-04-30 15:38:03 +00:00
bool IsAiming();
2022-04-28 10:18:21 +00:00
};