blaster/Source/Blaster/Components/CombatComponent.h

33 lines
843 B
C
Raw Normal View History

2022-04-30 11:09:28 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "CombatComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BLASTER_API UCombatComponent : public UActorComponent
{
GENERATED_BODY()
public:
UCombatComponent();
friend class ABlasterCharacter;
2022-04-30 14:48:34 +00:00
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
2022-04-30 11:09:28 +00:00
void EquipWeapon(class AWeapon* WeaponToEquip);
protected:
virtual void BeginPlay() override;
private:
class ABlasterCharacter* Character;
2022-04-30 14:48:34 +00:00
UPROPERTY(Replicated)
2022-04-30 11:09:28 +00:00
class AWeapon* EquippedWeapon;
};