|
|
|
|
| #pragma once
|
|
|
| #include "CoreMinimal.h"
|
| #include "GameFramework/PlayerController.h"
|
| #include "EnhancedInput/Public/InputAction.h"
|
| #include "SideScrollingPlayerController.generated.h"
|
|
|
| class ASideScrollingCharacter;
|
| class UInputMappingContext;
|
|
|
| |
| |
| |
| |
|
|
| UCLASS(abstract, Config="Game")
|
| class ASideScrollingPlayerController : public APlayerController
|
| {
|
| GENERATED_BODY()
|
|
|
| protected:
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Input|Input Mappings")
|
| TArray<UInputMappingContext*> DefaultMappingContexts;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Input|Input Mappings")
|
| TArray<UInputMappingContext*> MobileExcludedMappingContexts;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Input|Touch Controls")
|
| TSubclassOf<UUserWidget> MobileControlsWidgetClass;
|
|
|
|
|
| UPROPERTY()
|
| TObjectPtr<UUserWidget> MobileControlsWidget;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Config, Category = "Input|Touch Controls")
|
| bool bForceTouchControls = false;
|
|
|
|
|
| UPROPERTY(EditAnywhere, Category="Respawn")
|
| TSubclassOf<ASideScrollingCharacter> CharacterClass;
|
|
|
| protected:
|
|
|
|
|
| virtual void BeginPlay() override;
|
|
|
|
|
| virtual void SetupInputComponent() override;
|
|
|
|
|
| virtual void OnPossess(APawn* InPawn) override;
|
|
|
|
|
| UFUNCTION()
|
| void OnPawnDestroyed(AActor* DestroyedActor);
|
|
|
|
|
| bool ShouldUseTouchControls() const;
|
|
|
| };
|
|
|