RealtimeStyleTransferRuntime/Source/LyraGame/Weapons/LyraWeaponInstance.h

57 lines
1.6 KiB
C
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Cosmetics/LyraCosmeticAnimationTypes.h"
2022-09-13 07:18:28 +00:00
#include "Equipment/LyraEquipmentInstance.h"
#include "Templates/SubclassOf.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "LyraWeaponInstance.generated.h"
2022-09-13 07:18:28 +00:00
class UAnimInstance;
class UObject;
struct FFrame;
struct FGameplayTagContainer;
2022-05-23 18:41:30 +00:00
/**
* ULyraWeaponInstance
*
* A piece of equipment representing a weapon spawned and applied to a pawn
*/
UCLASS()
class ULyraWeaponInstance : public ULyraEquipmentInstance
{
GENERATED_BODY()
public:
ULyraWeaponInstance(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
//~ULyraEquipmentInstance interface
virtual void OnEquipped();
virtual void OnUnequipped();
//~End of ULyraEquipmentInstance interface
UFUNCTION(BlueprintCallable)
void UpdateFiringTime();
// Returns how long it's been since the weapon was interacted with (fired or equipped)
UFUNCTION(BlueprintPure)
float GetTimeSinceLastInteractedWith() const;
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Animation)
FLyraAnimLayerSelectionSet EquippedAnimSet;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Animation)
FLyraAnimLayerSelectionSet UneuippedAnimSet;
// Choose the best layer from EquippedAnimSet or UneuippedAnimSet based on the specified gameplay tags
UFUNCTION(BlueprintCallable, BlueprintPure=false, Category=Animation)
TSubclassOf<UAnimInstance> PickBestAnimLayer(bool bEquipped, const FGameplayTagContainer& CosmeticTags) const;
private:
double TimeLastEquipped = 0.0;
double TimeLastFired = 0.0;
};