diff --git a/SeagullGame/.idea/.idea.SeagullGame.dir/.idea/indexLayout.xml b/SeagullGame/.idea/.idea.SeagullGame.dir/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/SeagullGame/.idea/.idea.SeagullGame.dir/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SeagullGame/Config/DefaultEngine.ini b/SeagullGame/Config/DefaultEngine.ini
index 8ee7e13..aeaf96b 100644
--- a/SeagullGame/Config/DefaultEngine.ini
+++ b/SeagullGame/Config/DefaultEngine.ini
@@ -1,19 +1,15 @@
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/TopDown/Maps/TopDownMap.TopDownMap
EditorStartupMap=/Game/TopDown/Maps/TopDownMap.TopDownMap
-GlobalDefaultGameMode="/Script/SeagullGame.SeagullGameGameMode"
+GlobalDefaultGameMode=/Script/SeagullGame.SeagullGameGameMode
[/Script/Engine.RendererSettings]
r.Mobile.EnableNoPrecomputedLightingCSMShader=1
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=true
-
r.GenerateMeshDistanceFields=True
-
r.DynamicGlobalIlluminationMethod=1
-
r.ReflectionMethod=1
-
r.Shadow.Virtual.Enable=1
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
@@ -45,7 +41,6 @@ CompressionQualityModifier=1.000000
AutoStreamingThreshold=0.000000
SoundCueCookQualityIndex=-1
-
[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
@@ -55,6 +50,8 @@ AppliedDefaultGraphicsPerformance=Maximum
[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_TopDown",NewGameName="/Script/SeagullGame")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_TopDown",NewGameName="/Script/SeagullGame")
++ActiveGameNameRedirects=(OldGameName="/Script/TP_ThirdPerson",NewGameName="/Script/SeagullGame")
++ActiveGameNameRedirects=(OldGameName="TP_ThirdPerson",NewGameName="/Script/SeagullGame")
+ActiveClassRedirects=(OldClassName="TP_TopDownPlayerController",NewClassName="SeagullGamePlayerController")
+ActiveClassRedirects=(OldClassName="TP_TopDownGameMode",NewClassName="SeagullGameGameMode")
+ActiveClassRedirects=(OldClassName="TP_TopDownCharacter",NewClassName="SeagullGameCharacter")
diff --git a/SeagullGame/Config/DefaultInput.ini b/SeagullGame/Config/DefaultInput.ini
index e9f5815..95b0010 100644
--- a/SeagullGame/Config/DefaultInput.ini
+++ b/SeagullGame/Config/DefaultInput.ini
@@ -68,6 +68,7 @@ bEnableLegacyInputScales=True
bEnableMotionControls=True
bFilterInputByPlatformUser=False
bShouldFlushPressedKeysOnViewportFocusLost=True
+bEnableDynamicComponentInputBinding=True
bAlwaysShowTouchInterface=False
bShowConsoleOnFourFingerTap=True
bEnableGestureRecognizer=False
@@ -76,6 +77,18 @@ DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown
DefaultViewportMouseLockMode=LockOnCapture
FOVScale=0.011110
DoubleClickTime=0.200000
++ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Bottom)
++ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=SpaceBar)
++AxisMappings=(AxisName="Look Up / Down Gamepad",Scale=1.000000,Key=Gamepad_RightY)
++AxisMappings=(AxisName="Look Up / Down Mouse",Scale=-1.000000,Key=MouseY)
++AxisMappings=(AxisName="Move Forward / Backward",Scale=1.000000,Key=Gamepad_LeftY)
++AxisMappings=(AxisName="Move Forward / Backward",Scale=-1.000000,Key=S)
++AxisMappings=(AxisName="Move Forward / Backward",Scale=1.000000,Key=W)
++AxisMappings=(AxisName="Move Right / Left",Scale=-1.000000,Key=A)
++AxisMappings=(AxisName="Move Right / Left",Scale=1.000000,Key=D)
++AxisMappings=(AxisName="Move Right / Left",Scale=1.000000,Key=Gamepad_LeftX)
++AxisMappings=(AxisName="Turn Right / Left Gamepad",Scale=1.000000,Key=Gamepad_RightX)
++AxisMappings=(AxisName="Turn Right / Left Mouse",Scale=1.000000,Key=MouseX)
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
DefaultTouchInterface=None
diff --git a/SeagullGame/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset b/SeagullGame/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset
index 42ddaa2..d4c0cca 100644
--- a/SeagullGame/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset
+++ b/SeagullGame/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:31a8e81636ec9331cf7e224bff94514c7e0c868510b9b3c78072f27a05ac3e4e
-size 24861
+oid sha256:14593dfc90099c32b800d6cefe6e65c31a94f9a393322b333a77e7792fdf6162
+size 26096
diff --git a/SeagullGame/Content/TopDown/Blueprints/BP_TopDownPlayerController.uasset b/SeagullGame/Content/TopDown/Blueprints/BP_TopDownPlayerController.uasset
index b4387a2..21be16c 100644
--- a/SeagullGame/Content/TopDown/Blueprints/BP_TopDownPlayerController.uasset
+++ b/SeagullGame/Content/TopDown/Blueprints/BP_TopDownPlayerController.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:374816d5e29b8ba7f9dcf4fbe7005462ff7f6e5a357701cc204510ddf58899df
-size 19841
+oid sha256:5da2942402a873129152035c30547bece0fca1e8289cc710273ce98c0de47ce4
+size 18965
diff --git a/SeagullGame/Content/TopDown/Blueprints/MySeagullGameGameMode.uasset b/SeagullGame/Content/TopDown/Blueprints/MySeagullGameGameMode.uasset
new file mode 100644
index 0000000..c72e83e
--- /dev/null
+++ b/SeagullGame/Content/TopDown/Blueprints/MySeagullGameGameMode.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:28c6755c6a1a067665e06f780dece844d4ee56c82c305730a5c6b13b72c109c7
+size 19548
diff --git a/SeagullGame/Content/TopDown/Input/Actions/IAS_Jump.uasset b/SeagullGame/Content/TopDown/Input/Actions/IAS_Jump.uasset
new file mode 100644
index 0000000..a5c01b6
--- /dev/null
+++ b/SeagullGame/Content/TopDown/Input/Actions/IAS_Jump.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:216f9ffeef352e3e51227f2c35d55797febee1c5b5d6a35f32fb6a61dc0708e7
+size 1347
diff --git a/SeagullGame/Content/TopDown/Input/Actions/IAS_Look.uasset b/SeagullGame/Content/TopDown/Input/Actions/IAS_Look.uasset
new file mode 100644
index 0000000..0111217
--- /dev/null
+++ b/SeagullGame/Content/TopDown/Input/Actions/IAS_Look.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:784029c77c16f9184835a43ed59ca7e42ce542f9629fa6628c193734e075ff1d
+size 1494
diff --git a/SeagullGame/Content/TopDown/Input/Actions/IAS_Move.uasset b/SeagullGame/Content/TopDown/Input/Actions/IAS_Move.uasset
new file mode 100644
index 0000000..bc91b33
--- /dev/null
+++ b/SeagullGame/Content/TopDown/Input/Actions/IAS_Move.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dca6ba751ff094de4bb31eba6eeb07c2ebe7be222033dd00935daedad4fe795d
+size 1494
diff --git a/SeagullGame/Content/TopDown/Input/Actions/IA_SetDestination_Click.uasset b/SeagullGame/Content/TopDown/Input/Actions/IA_SetDestination_Click.uasset
deleted file mode 100644
index 38bda4b..0000000
--- a/SeagullGame/Content/TopDown/Input/Actions/IA_SetDestination_Click.uasset
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1d95ee2d091397c66aef549c3e4e00746a600858f2af3edc55254d74fa56136f
-size 1436
diff --git a/SeagullGame/Content/TopDown/Input/Actions/IA_SetDestination_Touch.uasset b/SeagullGame/Content/TopDown/Input/Actions/IA_SetDestination_Touch.uasset
deleted file mode 100644
index accde4c..0000000
--- a/SeagullGame/Content/TopDown/Input/Actions/IA_SetDestination_Touch.uasset
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e540c5008986008cde80bb27becc74f9fe325b6dea5af85977e5c96173076b1d
-size 1436
diff --git a/SeagullGame/Content/TopDown/Input/IMC_Default.uasset b/SeagullGame/Content/TopDown/Input/IMC_Default.uasset
deleted file mode 100644
index 2088f49..0000000
--- a/SeagullGame/Content/TopDown/Input/IMC_Default.uasset
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ccc2cdbeced88d31a01df20c67c059faa3874626d9814e59c210e8843becd364
-size 3099
diff --git a/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset b/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset
new file mode 100644
index 0000000..8728061
--- /dev/null
+++ b/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9d09e937cda8a135a12b4087e326939fd58d6c10a913d395a39cf38f5fd0a34e
+size 12875
diff --git a/SeagullGame/Content/TopDown/Maps/TopDownMap.umap b/SeagullGame/Content/TopDown/Maps/TopDownMap.umap
index 5ad92dd..1bfd5b5 100644
--- a/SeagullGame/Content/TopDown/Maps/TopDownMap.umap
+++ b/SeagullGame/Content/TopDown/Maps/TopDownMap.umap
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2292dd8cb5f7f538cf0025d7c859cdeda734ec31ab0b11c607b6c8aef0786487
-size 33529
+oid sha256:4161eb70e8dccc523f1ef4ca393714cd7aa1e25708fa073c0527c48348e40db4
+size 34721
diff --git a/SeagullGame/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/D/SY/Z4CTQ4LG3YV10EKPD0UE8Q.uasset b/SeagullGame/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/D/SY/Z4CTQ4LG3YV10EKPD0UE8Q.uasset
new file mode 100644
index 0000000..f11a8a5
--- /dev/null
+++ b/SeagullGame/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/D/SY/Z4CTQ4LG3YV10EKPD0UE8Q.uasset
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:995cdd512dce13ac9558af165778c54f71b12b16898400599f86fa6ca30444ed
+size 849
diff --git a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp
index 61fa5c2..7741f58 100644
--- a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp
+++ b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "SeagullGameCharacter.h"
+
+#include "EnhancedInputComponent.h"
+#include "EnhancedInputSubsystems.h"
#include "UObject/ConstructorHelpers.h"
#include "Camera/CameraComponent.h"
#include "Components/DecalComponent.h"
@@ -47,5 +50,66 @@ ASeagullGameCharacter::ASeagullGameCharacter()
void ASeagullGameCharacter::Tick(float DeltaSeconds)
{
- Super::Tick(DeltaSeconds);
+ Super::Tick(DeltaSeconds);
+}
+
+void ASeagullGameCharacter::BeginPlay()
+{
+ Super::BeginPlay();
+
+ //Add Input Mapping Context
+ if (APlayerController* PlayerController = Cast(Controller))
+ {
+ if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem(PlayerController->GetLocalPlayer()))
+ {
+ Subsystem->AddMappingContext(DefaultMappingContext, 0);
+ }
+ }
+}
+
+void ASeagullGameCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
+{
+ // Set up action bindings
+ if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked(PlayerInputComponent)) {
+
+ //Jumping
+ EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ACharacter::Jump);
+ EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping);
+
+ //Moving
+ EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ASeagullGameCharacter::Move);
+
+ //Looking
+ // EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &ATP_ThirdPersonCharacter::Look);
+
+ }
+}
+
+void ASeagullGameCharacter::Move(const FInputActionValue& Value)
+{
+ // input is a Vector2D
+ FVector2D MovementVector = Value.Get();
+
+ GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Move: %f, %f"), MovementVector.X, MovementVector.Y));
+
+ if (Controller != nullptr)
+ {
+ // find out which way is forward
+ const FRotator Rotation = Controller->GetControlRotation();
+ const FRotator YawRotation(0, Rotation.Yaw, 0);
+
+ // get forward vector
+ const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
+
+ // get right vector
+ const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
+
+ // add movement
+ AddMovementInput(ForwardDirection, MovementVector.Y);
+ AddMovementInput(RightDirection, MovementVector.X);
+ }
+}
+
+void ASeagullGameCharacter::Look(const FInputActionValue& Value)
+{
}
diff --git a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h
index a9075f7..4804fbd 100644
--- a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h
+++ b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h
@@ -3,6 +3,7 @@
#pragma once
#include "CoreMinimal.h"
+#include "InputActionValue.h"
#include "GameFramework/Character.h"
#include "SeagullGameCharacter.generated.h"
@@ -17,10 +18,36 @@ public:
// Called every frame.
virtual void Tick(float DeltaSeconds) override;
- /** Returns TopDownCameraComponent subobject **/
+ /** Returns TopDownCameraComponent sub-object **/
FORCEINLINE class UCameraComponent* GetTopDownCameraComponent() const { return TopDownCameraComponent; }
- /** Returns CameraBoom subobject **/
+ /** Returns CameraBoom sub-object **/
FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
+ /** MappingContext */
+ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
+ class UInputMappingContext* DefaultMappingContext;
+
+ /** Jump Input Action */
+ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
+ class UInputAction* JumpAction;
+
+ /** Move Input Action */
+ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
+ class UInputAction* MoveAction;
+
+ /** Look Input Action */
+ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
+ class UInputAction* LookAction;
+
+ virtual void BeginPlay() override;
+
+protected:
+ // APawn interface
+ virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
+ /** Called for movement input */
+ void Move(const FInputActionValue& Value);
+
+ /** Called for looking input */
+ void Look(const FInputActionValue& Value);
private:
/** Top down camera */
@@ -30,5 +57,5 @@ private:
/** Camera boom positioning the camera above the character */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class USpringArmComponent* CameraBoom;
-};
+};
diff --git a/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.cpp b/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.cpp
index a770cd6..279c581 100644
--- a/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.cpp
+++ b/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.cpp
@@ -12,106 +12,12 @@
ASeagullGamePlayerController::ASeagullGamePlayerController()
{
- bShowMouseCursor = true;
- DefaultMouseCursor = EMouseCursor::Default;
- CachedDestination = FVector::ZeroVector;
- FollowTime = 0.f;
+
}
void ASeagullGamePlayerController::BeginPlay()
{
// Call the base class
Super::BeginPlay();
-
- //Add Input Mapping Context
- if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem(GetLocalPlayer()))
- {
- Subsystem->AddMappingContext(DefaultMappingContext, 0);
- }
-}
-
-void ASeagullGamePlayerController::SetupInputComponent()
-{
- // set up gameplay key bindings
- Super::SetupInputComponent();
-
- // Set up action bindings
- if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked(InputComponent))
- {
- // Setup mouse input events
- EnhancedInputComponent->BindAction(SetDestinationClickAction, ETriggerEvent::Started, this, &ASeagullGamePlayerController::OnInputStarted);
- EnhancedInputComponent->BindAction(SetDestinationClickAction, ETriggerEvent::Triggered, this, &ASeagullGamePlayerController::OnSetDestinationTriggered);
- EnhancedInputComponent->BindAction(SetDestinationClickAction, ETriggerEvent::Completed, this, &ASeagullGamePlayerController::OnSetDestinationReleased);
- EnhancedInputComponent->BindAction(SetDestinationClickAction, ETriggerEvent::Canceled, this, &ASeagullGamePlayerController::OnSetDestinationReleased);
-
- // Setup touch input events
- EnhancedInputComponent->BindAction(SetDestinationTouchAction, ETriggerEvent::Started, this, &ASeagullGamePlayerController::OnInputStarted);
- EnhancedInputComponent->BindAction(SetDestinationTouchAction, ETriggerEvent::Triggered, this, &ASeagullGamePlayerController::OnTouchTriggered);
- EnhancedInputComponent->BindAction(SetDestinationTouchAction, ETriggerEvent::Completed, this, &ASeagullGamePlayerController::OnTouchReleased);
- EnhancedInputComponent->BindAction(SetDestinationTouchAction, ETriggerEvent::Canceled, this, &ASeagullGamePlayerController::OnTouchReleased);
- }
-}
-
-void ASeagullGamePlayerController::OnInputStarted()
-{
- StopMovement();
-}
-
-// Triggered every frame when the input is held down
-void ASeagullGamePlayerController::OnSetDestinationTriggered()
-{
- // We flag that the input is being pressed
- FollowTime += GetWorld()->GetDeltaSeconds();
- // We look for the location in the world where the player has pressed the input
- FHitResult Hit;
- bool bHitSuccessful = false;
- if (bIsTouch)
- {
- bHitSuccessful = GetHitResultUnderFinger(ETouchIndex::Touch1, ECollisionChannel::ECC_Visibility, true, Hit);
- }
- else
- {
- bHitSuccessful = GetHitResultUnderCursor(ECollisionChannel::ECC_Visibility, true, Hit);
- }
-
- // If we hit a surface, cache the location
- if (bHitSuccessful)
- {
- CachedDestination = Hit.Location;
- }
-
- // Move towards mouse pointer or touch
- APawn* ControlledPawn = GetPawn();
- if (ControlledPawn != nullptr)
- {
- FVector WorldDirection = (CachedDestination - ControlledPawn->GetActorLocation()).GetSafeNormal();
- ControlledPawn->AddMovementInput(WorldDirection, 1.0, false);
- }
-}
-
-void ASeagullGamePlayerController::OnSetDestinationReleased()
-{
- // If it was a short press
- if (FollowTime <= ShortPressThreshold)
- {
- // We move there and spawn some particles
- UAIBlueprintHelperLibrary::SimpleMoveToLocation(this, CachedDestination);
- UNiagaraFunctionLibrary::SpawnSystemAtLocation(this, FXCursor, CachedDestination, FRotator::ZeroRotator, FVector(1.f, 1.f, 1.f), true, true, ENCPoolMethod::None, true);
- }
-
- FollowTime = 0.f;
-}
-
-// Triggered every frame when the input is held down
-void ASeagullGamePlayerController::OnTouchTriggered()
-{
- bIsTouch = true;
- OnSetDestinationTriggered();
-}
-
-void ASeagullGamePlayerController::OnTouchReleased()
-{
- bIsTouch = false;
- OnSetDestinationReleased();
}
diff --git a/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.h b/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.h
index 05a396e..51598c7 100644
--- a/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.h
+++ b/SeagullGame/Source/SeagullGame/SeagullGamePlayerController.h
@@ -19,47 +19,11 @@ class ASeagullGamePlayerController : public APlayerController
public:
ASeagullGamePlayerController();
- /** 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;
-
- /** MappingContext */
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input, meta=(AllowPrivateAccess = "true"))
- class UInputMappingContext* DefaultMappingContext;
-
- /** Jump Input Action */
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input, meta=(AllowPrivateAccess = "true"))
- class UInputAction* SetDestinationClickAction;
-
- /** Jump Input Action */
- UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input, meta=(AllowPrivateAccess = "true"))
- class UInputAction* SetDestinationTouchAction;
-
protected:
- /** True if the controlled character should navigate to the mouse cursor. */
- uint32 bMoveToMouseCursor : 1;
-
- virtual void SetupInputComponent() override;
-
- // To add mapping context
- virtual void BeginPlay();
-
- /** Input handlers for SetDestination action. */
- void OnInputStarted();
- void OnSetDestinationTriggered();
- void OnSetDestinationReleased();
- void OnTouchTriggered();
- void OnTouchReleased();
+ virtual void BeginPlay() override;
private:
- FVector CachedDestination;
- bool bIsTouch; // Is it a touch device
- float FollowTime; // For how long it has been pressed
};