unitysamples / LyraStarterGame /Source /LyraGame /UI /Weapons /LyraWeaponUserInterface.h
Alexhas2's picture
Add files using upload-large-folder tool
7fd553e verified
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CommonUserWidget.h"
#include "LyraWeaponUserInterface.generated.h"
class ULyraWeaponInstance;
class UObject;
struct FGeometry;
UCLASS()
class ULyraWeaponUserInterface : public UCommonUserWidget
{
GENERATED_BODY()
public:
ULyraWeaponUserInterface(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
virtual void NativeConstruct() override;
virtual void NativeDestruct() override;
virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
UFUNCTION(BlueprintImplementableEvent)
void OnWeaponChanged(ULyraWeaponInstance* OldWeapon, ULyraWeaponInstance* NewWeapon);
private:
void RebuildWidgetFromWeapon();
private:
UPROPERTY(Transient)
TObjectPtr<ULyraWeaponInstance> CurrentInstance;
};