Added Move Controls
This commit is contained in:
parent
db97d5cd35
commit
8e7ca53d56
@ -21,6 +21,18 @@
|
|||||||
"BuildId": "37670630"
|
"BuildId": "37670630"
|
||||||
},
|
},
|
||||||
"BuildProducts": [
|
"BuildProducts": [
|
||||||
|
{
|
||||||
|
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.dll",
|
||||||
|
"Type": "DynamicLibrary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.pdb",
|
||||||
|
"Type": "SymbolFile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules",
|
||||||
|
"Type": "RequiredResource"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Binaries/ThirdParty/USD/UsdResources/Win64/plugins/ar/resources/plugInfo.json",
|
"Path": "$(EngineDir)/Binaries/ThirdParty/USD/UsdResources/Win64/plugins/ar/resources/plugInfo.json",
|
||||||
"Type": "RequiredResource"
|
"Type": "RequiredResource"
|
||||||
@ -4872,21 +4884,13 @@
|
|||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules",
|
"Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules",
|
||||||
"Type": "RequiredResource"
|
"Type": "RequiredResource"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.dll",
|
|
||||||
"Type": "DynamicLibrary"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.pdb",
|
|
||||||
"Type": "SymbolFile"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules",
|
|
||||||
"Type": "RequiredResource"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"RuntimeDependencies": [
|
"RuntimeDependencies": [
|
||||||
|
{
|
||||||
|
"Path": "$(ProjectDir)/LegumeMix.uproject",
|
||||||
|
"Type": "UFS"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll",
|
"Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll",
|
||||||
"Type": "NonUFS"
|
"Type": "NonUFS"
|
||||||
@ -30614,10 +30618,6 @@
|
|||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin",
|
"Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "$(ProjectDir)/LegumeMix.uproject",
|
|
||||||
"Type": "UFS"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"BuildPlugins": [
|
"BuildPlugins": [
|
||||||
|
BIN
Binaries/Win64/UnrealEditor-LegumeMix.exp
(Stored with Git LFS)
BIN
Binaries/Win64/UnrealEditor-LegumeMix.exp
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:e84b4b7673f86d993c6008878a4fe2cf485eb54beb76bafa7f6a9cbe068df991
|
oid sha256:4bd9e85e6cbd527b51099c9ee1800a227ff79bda18d26ac40b665732b99cbd36
|
||||||
size 57430016
|
size 59527168
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
[/Script/EngineSettings.GameMapsSettings]
|
[/Script/EngineSettings.GameMapsSettings]
|
||||||
GameDefaultMap=/Engine/Maps/Templates/OpenWorld
|
GameDefaultMap=/Engine/Maps/Templates/OpenWorld
|
||||||
|
GlobalDefaultGameMode=/Game/Legumix/BP_GameMode.BP_GameMode_C
|
||||||
|
|
||||||
[/Script/Engine.RendererSettings]
|
[/Script/Engine.RendererSettings]
|
||||||
r.AllowStaticLighting=False
|
r.AllowStaticLighting=False
|
||||||
|
BIN
Content/Legumix/BP_GameMode.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/BP_GameMode.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/BP_Player.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/BP_Player.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/BP_PlayerController.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/BP_PlayerController.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IA_Jump.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/Input/IA_Jump.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IA_Look.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/Input/IA_Look.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IA_Move.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/Input/IA_Move.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IA_Shoot.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/Input/IA_Shoot.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IMC_Default.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/Input/IMC_Default.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -7,7 +7,10 @@
|
|||||||
{
|
{
|
||||||
"Name": "LegumeMix",
|
"Name": "LegumeMix",
|
||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default"
|
"LoadingPhase": "Default",
|
||||||
|
"AdditionalDependencies": [
|
||||||
|
"Engine"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Plugins": [
|
"Plugins": [
|
||||||
|
34
Source/LegumeMix/Private/Player/LMPlayer.cpp
Normal file
34
Source/LegumeMix/Private/Player/LMPlayer.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "Player/LMPlayer.h"
|
||||||
|
|
||||||
|
// Sets default values
|
||||||
|
ALMPlayer::ALMPlayer()
|
||||||
|
{
|
||||||
|
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
void ALMPlayer::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every frame
|
||||||
|
void ALMPlayer::Tick(float DeltaTime)
|
||||||
|
{
|
||||||
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called to bind functionality to input
|
||||||
|
void ALMPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||||
|
{
|
||||||
|
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
27
Source/LegumeMix/Private/Player/LMPlayerController.cpp
Normal file
27
Source/LegumeMix/Private/Player/LMPlayerController.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "Player/LMPlayerController.h"
|
||||||
|
#include "EnhancedInputSubsystems.h"
|
||||||
|
#include "EnhancedInputComponent.h"
|
||||||
|
|
||||||
|
void ALMPlayerController::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
EnhancedInputSubsystem = GetLocalPlayer()->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>();
|
||||||
|
EnhancedInputSubsystem->AddMappingContext(DefaultMappingContext, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ALMPlayerController::SetupInputComponent()
|
||||||
|
{
|
||||||
|
Super::SetupInputComponent();
|
||||||
|
UEnhancedInputComponent* Input = Cast<UEnhancedInputComponent>(InputComponent);
|
||||||
|
Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ALMPlayerController::Move(const FInputActionValue& InputValue)
|
||||||
|
{
|
||||||
|
const FVector2d VectorDirection = InputValue.Get<FVector2d>();
|
||||||
|
GetPawn()->AddMovementInput(GetPawn()->GetActorForwardVector(), VectorDirection.X);
|
||||||
|
GetPawn()->AddMovementInput(GetPawn()->GetActorRightVector(), VectorDirection.Y);
|
||||||
|
}
|
29
Source/LegumeMix/Public/Player/LMPlayer.h
Normal file
29
Source/LegumeMix/Public/Player/LMPlayer.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/Character.h"
|
||||||
|
#include "LMPlayer.generated.h"
|
||||||
|
|
||||||
|
UCLASS()
|
||||||
|
class LEGUMEMIX_API ALMPlayer : public ACharacter
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Sets default values for this character's properties
|
||||||
|
ALMPlayer();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Called every frame
|
||||||
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
|
// Called to bind functionality to input
|
||||||
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||||
|
|
||||||
|
};
|
41
Source/LegumeMix/Public/Player/LMPlayerController.h
Normal file
41
Source/LegumeMix/Public/Player/LMPlayerController.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/PlayerController.h"
|
||||||
|
#include "EnhancedInputSubsystems.h"
|
||||||
|
#include "LMPlayerController.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class LEGUMEMIX_API ALMPlayerController : public APlayerController
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
UPROPERTY()
|
||||||
|
UEnhancedInputLocalPlayerSubsystem* EnhancedInputSubsystem;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowprivateAccess = true))
|
||||||
|
TObjectPtr<UInputMappingContext> DefaultMappingContext;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||||
|
TObjectPtr<UInputAction> MoveAction;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||||
|
TObjectPtr<UInputAction> LookAction;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||||
|
TObjectPtr<UInputAction> JumpAction;
|
||||||
|
|
||||||
|
virtual void SetupInputComponent() override;
|
||||||
|
void Move(const FInputActionValue& InputValue);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
Reference in New Issue
Block a user