-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathProceduralBuildingsPlayerController.h
50 lines (37 loc) · 1.44 KB
/
ProceduralBuildingsPlayerController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Templates/SubclassOf.h"
#include "GameFramework/PlayerController.h"
#include "ProceduralBuildingsPlayerController.generated.h"
/** Forward declaration to improve compiling times */
class UNiagaraSystem;
UCLASS()
class AProceduralBuildingsPlayerController : public APlayerController
{
GENERATED_BODY()
public:
AProceduralBuildingsPlayerController();
/** Time Threshold to know if it was a short press */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
float ShortPressThreshold;
/** FX Class that we will spawn when clicking */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
UNiagaraSystem* FXCursor;
protected:
/** True if the controlled character should navigate to the mouse cursor. */
uint32 bMoveToMouseCursor : 1;
// Begin PlayerController interface
virtual void PlayerTick(float DeltaTime) override;
virtual void SetupInputComponent() override;
// End PlayerController interface
/** Input handlers for SetDestination action. */
void OnSetDestinationPressed();
void OnSetDestinationReleased();
void OnTouchPressed(const ETouchIndex::Type FingerIndex, const FVector Location);
void OnTouchReleased(const ETouchIndex::Type FingerIndex, const FVector Location);
private:
bool bInputPressed; // Input is bring pressed
bool bIsTouch; // Is it a touch device
float FollowTime; // For how long it has been pressed
};