Make VRPlayerController just use UVRAbilitySystemComponent
parent
f2d8a1a14b
commit
3160d68a46
|
|
@ -60,8 +60,22 @@ void AVRPlayerController::OnPossess(APawn* InPawn)
|
||||||
UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetPawn()));
|
UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetPawn()));
|
||||||
}
|
}
|
||||||
|
|
||||||
UAbilitySystemComponent* AVRPlayerController::GetAbilitySystemComponent()
|
// UAbilitySystemComponent* AVRPlayerController::GetAbilitySystemComponent()
|
||||||
|
// {
|
||||||
|
// if (!CachedAbilitySystemComponent.IsValid())
|
||||||
|
// {
|
||||||
|
// CachedAbilitySystemComponent = Cast<UVRAbilitySystemComponent>(
|
||||||
|
// UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetPawn()));
|
||||||
|
//
|
||||||
|
// if (!CachedAbilitySystemComponent.IsValid()) return nullptr;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return CachedAbilitySystemComponent.Get();
|
||||||
|
// }
|
||||||
|
|
||||||
|
UVRAbilitySystemComponent* AVRPlayerController::GetVRAbilitySystemComponent()
|
||||||
{
|
{
|
||||||
|
// return Cast<UVRAbilitySystemComponent>(GetAbilitySystemComponent());
|
||||||
if (!CachedAbilitySystemComponent.IsValid())
|
if (!CachedAbilitySystemComponent.IsValid())
|
||||||
{
|
{
|
||||||
CachedAbilitySystemComponent = Cast<UVRAbilitySystemComponent>(
|
CachedAbilitySystemComponent = Cast<UVRAbilitySystemComponent>(
|
||||||
|
|
@ -73,11 +87,6 @@ UAbilitySystemComponent* AVRPlayerController::GetAbilitySystemComponent()
|
||||||
return CachedAbilitySystemComponent.Get();
|
return CachedAbilitySystemComponent.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
UVRAbilitySystemComponent* AVRPlayerController::GetVRAbilitySystemComponent()
|
|
||||||
{
|
|
||||||
return Cast<UVRAbilitySystemComponent>(GetAbilitySystemComponent());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AVRPlayerController::Input_AbilityTagPressed(FGameplayTag InTag)
|
void AVRPlayerController::Input_AbilityTagPressed(FGameplayTag InTag)
|
||||||
{
|
{
|
||||||
if (!GetVRAbilitySystemComponent())
|
if (!GetVRAbilitySystemComponent())
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public:
|
||||||
|
|
||||||
//~ Begin APlayerController Interface
|
//~ Begin APlayerController Interface
|
||||||
virtual void PostProcessInput(const float DeltaTime, const bool bGamePaused) override;
|
virtual void PostProcessInput(const float DeltaTime, const bool bGamePaused) override;
|
||||||
//~ End APlayerContoller Interface
|
//~ End APlayerController Interface
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// TODO: Implement controller
|
// TODO: Implement controller
|
||||||
|
|
@ -42,10 +42,10 @@ protected:
|
||||||
|
|
||||||
#pragma region GAS
|
#pragma region GAS
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
TWeakObjectPtr<UAbilitySystemComponent> CachedAbilitySystemComponent;
|
TWeakObjectPtr<UVRAbilitySystemComponent> CachedAbilitySystemComponent;
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category = "AbilitySystem", meta = (HideSelfPin))
|
// UFUNCTION(BlueprintPure, Category = "AbilitySystem", meta = (HideSelfPin))
|
||||||
UAbilitySystemComponent* GetAbilitySystemComponent();
|
// UAbilitySystemComponent* GetAbilitySystemComponent();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category = "AbilitySystem", meta = (HideSelfPin))
|
UFUNCTION(BlueprintPure, Category = "AbilitySystem", meta = (HideSelfPin))
|
||||||
UVRAbilitySystemComponent* GetVRAbilitySystemComponent();
|
UVRAbilitySystemComponent* GetVRAbilitySystemComponent();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue