|
|
|
|
| #pragma once
|
|
|
| #include "Engine/World.h"
|
|
|
| #include "LyraEquipmentInstance.generated.h"
|
|
|
| class AActor;
|
| class APawn;
|
| struct FFrame;
|
| struct FLyraEquipmentActorToSpawn;
|
|
|
| |
| |
| |
| |
|
|
| UCLASS(BlueprintType, Blueprintable)
|
| class ULyraEquipmentInstance : public UObject
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| ULyraEquipmentInstance(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
|
|
| virtual bool IsSupportedForNetworking() const override { return true; }
|
| virtual UWorld* GetWorld() const override final;
|
|
|
|
|
| UFUNCTION(BlueprintPure, Category=Equipment)
|
| UObject* GetInstigator() const { return Instigator; }
|
|
|
| void SetInstigator(UObject* InInstigator) { Instigator = InInstigator; }
|
|
|
| UFUNCTION(BlueprintPure, Category=Equipment)
|
| APawn* GetPawn() const;
|
|
|
| UFUNCTION(BlueprintPure, Category=Equipment, meta=(DeterminesOutputType=PawnType))
|
| APawn* GetTypedPawn(TSubclassOf<APawn> PawnType) const;
|
|
|
| UFUNCTION(BlueprintPure, Category=Equipment)
|
| TArray<AActor*> GetSpawnedActors() const { return SpawnedActors; }
|
|
|
| virtual void SpawnEquipmentActors(const TArray<FLyraEquipmentActorToSpawn>& ActorsToSpawn);
|
| virtual void DestroyEquipmentActors();
|
|
|
| virtual void OnEquipped();
|
| virtual void OnUnequipped();
|
|
|
| protected:
|
| #if UE_WITH_IRIS
|
|
|
| virtual void RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags) override;
|
| #endif
|
|
|
| UFUNCTION(BlueprintImplementableEvent, Category=Equipment, meta=(DisplayName="OnEquipped"))
|
| void K2_OnEquipped();
|
|
|
| UFUNCTION(BlueprintImplementableEvent, Category=Equipment, meta=(DisplayName="OnUnequipped"))
|
| void K2_OnUnequipped();
|
|
|
| private:
|
| UFUNCTION()
|
| void OnRep_Instigator();
|
|
|
| private:
|
| UPROPERTY(ReplicatedUsing=OnRep_Instigator)
|
| TObjectPtr<UObject> Instigator;
|
|
|
| UPROPERTY(Replicated)
|
| TArray<TObjectPtr<AActor>> SpawnedActors;
|
| };
|
|
|