Add VRAbilitySystemPlayerState
parent
021f30632a
commit
f2d8a1a14b
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright
|
||||
|
||||
|
||||
#include "Player/VRAbilitySystemPlayerState.h"
|
||||
|
||||
#include "AbilitySystemComponent.h"
|
||||
#include "AbilitySystem/VRAbilitySystemComponent.h"
|
||||
|
||||
AVRAbilitySystemPlayerState::AVRAbilitySystemPlayerState(FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
|
||||
{
|
||||
VRAbilitySystemComponent = ObjectInitializer.CreateDefaultSubobject<UVRAbilitySystemComponent>(this, TEXT("Ability System Component"));
|
||||
VRAbilitySystemComponent->SetIsReplicated(true);
|
||||
VRAbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);
|
||||
|
||||
// Do attribute sets in derived classes
|
||||
|
||||
// If multiplayer, update at a relatively high frequency to update ASC appropriately
|
||||
NetUpdateFrequency = 100.f; // This is the setting Lyra uses
|
||||
}
|
||||
|
||||
UAbilitySystemComponent* AVRAbilitySystemPlayerState::GetAbilitySystemComponent() const
|
||||
{
|
||||
return CastChecked<UAbilitySystemComponent>(VRAbilitySystemComponent);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "AbilitySystemInterface.h"
|
||||
#include "GameFramework/PlayerState.h"
|
||||
#include "VRAbilitySystemPlayerState.generated.h"
|
||||
|
||||
class UVRAbilitySystemComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class VRGAS_API AVRAbilitySystemPlayerState : public APlayerState, public IAbilitySystemInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// ReSharper disable once CppNonExplicitConvertingConstructor
|
||||
AVRAbilitySystemPlayerState(FObjectInitializer& ObjectInitializer);
|
||||
|
||||
//~ Begin IAbilitySystemInterface
|
||||
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
|
||||
//~ End IAbilitySystemInterface
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "AbilitySystem")
|
||||
UVRAbilitySystemComponent* VRAbilitySystemComponent;
|
||||
|
||||
};
|
||||
|
|
@ -44,10 +44,10 @@ protected:
|
|||
UPROPERTY()
|
||||
TWeakObjectPtr<UAbilitySystemComponent> CachedAbilitySystemComponent;
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Ability System", meta = (HideSelfPin))
|
||||
UFUNCTION(BlueprintPure, Category = "AbilitySystem", meta = (HideSelfPin))
|
||||
UAbilitySystemComponent* GetAbilitySystemComponent();
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Ability System", meta = (HideSelfPin))
|
||||
UFUNCTION(BlueprintPure, Category = "AbilitySystem", meta = (HideSelfPin))
|
||||
UVRAbilitySystemComponent* GetVRAbilitySystemComponent();
|
||||
|
||||
void Input_AbilityTagPressed(FGameplayTag InTag);
|
||||
|
|
|
|||
Loading…
Reference in New Issue