blaster/Source/Blaster/Character/BlasterCharacter.h

59 lines
1.5 KiB
C++

// 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();
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
virtual void PostInitializeComponents() override;
protected:
virtual void BeginPlay() override;
void MoveForward(float Value);
void MoveRight(float Value);
void Turn(float Value);
void LookUp(float Value);
void EquipButtonPressed();
void CrouchButtonPressed();
void AimButtonPressed();
void AimButtonReleased();
private:
UPROPERTY(VisibleAnywhere, Category="Camera")
class USpringArmComponent* CameraBoom;
UPROPERTY(VisibleAnywhere, Category="Camera")
class UCameraComponent* FollowCamera;
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UWidgetComponent* OverheadWidget;
UPROPERTY(ReplicatedUsing = OnRep_OverlappingWeapon)
class AWeapon* OverlappingWeapon;
UFUNCTION()
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);
UPROPERTY(VisibleAnywhere)
class UCombatComponent* Combat;
UFUNCTION(Server, Reliable)
void ServerEquipButtonPressed();
public:
void SetOverlappingWeapon(AWeapon* Weapon);
bool IsWeaponEquipped();
bool IsAiming();
};