document.write("
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "DandelionPlayerController.generated.h"
class UPathFollowingComponent;
class UInputMappingContext;
DECLARE_LOG_CATEGORY_EXTERN(LogTemplateCharacter, Log, All);
/**
* Base PlayerController class that defines default InputMappingContexts and includes a PathFollowingComponent to enable
* navigation.
*/
UCLASS(Blueprintable)
class ADandelionPlayerController : public APlayerController
{
GENERATED_BODY()
public:
/**
* Default constructor to show the default mouse cursor and to ensure that the PathFollowingComponent is present.
*/
ADandelionPlayerController();
/**
* When a StopMovement request is sent to NavSystem, also consume any player input on the Pawn.
*/
virtual void StopMovement() override;
protected:
/**
* Initializes the PathFollowingComponent once this controller possesses a Pawn whose path will be controlled.
* @param InPawn The possessed pawn.
*/
virtual void OnPossess(APawn* InPawn) override;
/**
* Applies the DefaultInputMappingContexts to this PlayerController.
*/
virtual void SetupInputComponent() override;
#pragma region Simple Getters
public:
/**
* Simple getter for the PathFollowingComponent.
* @return The PathFollowingComponent on this controller.
*/
FORCEINLINE UPathFollowingComponent* GetPathFollowingComponent() const { return PathFollowingComponent; }
#pragma endregion
private:
/**
* Input Mapping Contexts that should be applied to the PlayerController when setting up the InputComponent.
*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input", meta = (AllowPrivateAccess = "true"))
TSet<TObjectPtr<UInputMappingContext>> DefaultInputMappingContexts;
/**
* The PathFollowingComponent to be used to facilitate player pathing.
*/
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, meta=(AllowPrivateAccess=true))
TObjectPtr<UPathFollowingComponent> PathFollowingComponent;
};
DandelionPlayerController.h - Snippet hosted by \"Cacher\"
");