From f5767bb654a83866bc5f445d441fe8b1d5c4c40a Mon Sep 17 00:00:00 2001 From: meishibiezb <750783119@qq.com> Date: Sun, 15 Mar 2026 01:05:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=B7=91=E5=8A=A8?= =?UTF-8?q?=E5=85=B1=E5=97=AF=E9=82=A3=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/DefaultEngine.ini | 3 +++ Content/Blueprints/BP_TestChar.uasset | 4 ++-- Content/Inputs/IA/IA_RunAction.uasset | 3 +++ Content/Inputs/IMC/IMC_Context.uasset | 4 ++-- Source/lonese/MyCharacter.cpp | 7 +++++++ 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 Content/Inputs/IA/IA_RunAction.uasset diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 1353adb..dc96d83 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -51,3 +51,6 @@ ConnectionType=USBOnly bUseManualIPAddress=False ManualIPAddress= +[/Script/UnrealBuildTool.UnrealBuildTool] +bAllowGitCommandlineIntegration=False + diff --git a/Content/Blueprints/BP_TestChar.uasset b/Content/Blueprints/BP_TestChar.uasset index f825d16..c480c02 100644 --- a/Content/Blueprints/BP_TestChar.uasset +++ b/Content/Blueprints/BP_TestChar.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7cee5c08660418e74ed699ffc2467c3e8f04b9c044b25527a1e23611ad7aa453 -size 36236 +oid sha256:6ac38f4a38f72a3a97b438f3d68fd8eaac42b95a6402ac7457916168a33f2930 +size 36300 diff --git a/Content/Inputs/IA/IA_RunAction.uasset b/Content/Inputs/IA/IA_RunAction.uasset new file mode 100644 index 0000000..ff21243 --- /dev/null +++ b/Content/Inputs/IA/IA_RunAction.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61d2e56594b465611f7dbde4736f224d6b0e64fe38dc68b7925fa26808e7f7fc +size 1167 diff --git a/Content/Inputs/IMC/IMC_Context.uasset b/Content/Inputs/IMC/IMC_Context.uasset index c85dbb2..b99987c 100644 --- a/Content/Inputs/IMC/IMC_Context.uasset +++ b/Content/Inputs/IMC/IMC_Context.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16c09456d7dca23b046cb9540b811211cea1afbe8b6038bd72bbcec1089e7885 -size 4410 +oid sha256:19b9a971e8f3dfd8084835586af6704e6069ced3be12b0a4dcf066c89f9fada5 +size 4873 diff --git a/Source/lonese/MyCharacter.cpp b/Source/lonese/MyCharacter.cpp index aa3a3a6..c2b15d2 100644 --- a/Source/lonese/MyCharacter.cpp +++ b/Source/lonese/MyCharacter.cpp @@ -5,6 +5,7 @@ #include "EnhancedInputSubsystems.h" #include "EnhancedInputComponent.h" +#include "GameFramework/CharacterMovementComponent.h" void AMyCharacter::Move(const FInputActionValue& Value) { @@ -18,10 +19,12 @@ void AMyCharacter::Move(const FInputActionValue& Value) void AMyCharacter::BeginRun(const FInputActionValue& Value) { bIsRunning = true; + GetCharacterMovement()->MaxWalkSpeed = 1200.0f; } void AMyCharacter::StopRun(const FInputActionValue& Value) { bIsRunning = false; + GetCharacterMovement()->MaxWalkSpeed = 600.0f; } // Sets default values @@ -68,6 +71,10 @@ void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCompone if (MoveAction) { EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::Move); } + if (RunAction) { + EnhancedInputComponent->BindAction(RunAction, ETriggerEvent::Started, this, &AMyCharacter::BeginRun); + EnhancedInputComponent->BindAction(RunAction, ETriggerEvent::Completed, this, &AMyCharacter::StopRun); + } } }