generated from amasson/UnrealEngineProject
Compare commits
9 Commits
789919e388
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 564d0837c5 | |||
| 6edcd72294 | |||
| 848eb649ab | |||
| 3b3667245b | |||
| 829ec88126 | |||
| dc32b6a1d0 | |||
| 67c6294ae3 | |||
|
|
2bb7f2b6b1 | ||
|
|
5bfff25380 |
12
.gitmodules
vendored
12
.gitmodules
vendored
@@ -1,3 +1,15 @@
|
||||
[submodule "Plugins/LibAmasson"]
|
||||
path = Plugins/LibAmasson
|
||||
url = https://github.com/amasson42/LibAmasson-unreal-plugin.git
|
||||
[submodule "Plugins/GasRpg"]
|
||||
path = Plugins/GasRpg
|
||||
url = https://github.com/amasson42/GasRpg-unreal-plugin.git
|
||||
[submodule "Plugins/FactionSystem"]
|
||||
path = Plugins/FactionSystem
|
||||
url = https://github.com/amasson42/FactionSystem-unreal-plugin.git
|
||||
[submodule "Plugins/InteractionSystem"]
|
||||
path = Plugins/InteractionSystem
|
||||
url = https://github.com/amasson42/InteractionSystem-unreal-plugin.git
|
||||
[submodule "Plugins/SlotBasedInventorySystem"]
|
||||
path = Plugins/SlotBasedInventorySystem
|
||||
url = https://github.com/amasson42/SlotBasedInventorySystem-unreal-plugin.git
|
||||
|
||||
@@ -33,6 +33,9 @@ CompressionQualityModifier=1.000000
|
||||
AutoStreamingThreshold=0.000000
|
||||
SoundCueCookQualityIndex=-1
|
||||
|
||||
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
|
||||
-TargetedRHIs=SF_VULKAN_SM5
|
||||
+TargetedRHIs=SF_VULKAN_SM6
|
||||
|
||||
[/Script/HardwareTargeting.HardwareTargetingSettings]
|
||||
TargetedHardwareClass=Desktop
|
||||
@@ -41,6 +44,7 @@ DefaultGraphicsPerformance=Maximum
|
||||
AppliedDefaultGraphicsPerformance=Maximum
|
||||
|
||||
[/Script/Engine.RendererSettings]
|
||||
r.Mobile.EnableNoPrecomputedLightingCSMShader=True
|
||||
r.GenerateMeshDistanceFields=True
|
||||
r.DynamicGlobalIlluminationMethod=1
|
||||
r.ReflectionMethod=1
|
||||
@@ -48,6 +52,7 @@ r.Shadow.Virtual.Enable=1
|
||||
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
|
||||
r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8
|
||||
r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8
|
||||
r.CustomDepth=3
|
||||
|
||||
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
|
||||
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'
|
||||
@@ -58,8 +63,10 @@ FontDPIPreset=Standard
|
||||
FontDPI=72
|
||||
|
||||
[/Script/Engine.Engine]
|
||||
+ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/Wailing")
|
||||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/Wailing")
|
||||
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/Wailing")
|
||||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/Wailing")
|
||||
AssetManagerClassName=/Script/GasRpg.GasRpgAssetManager
|
||||
bUseFixedFrameRate=True
|
||||
|
||||
[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
|
||||
bEnablePlugin=True
|
||||
|
||||
@@ -2,7 +2,15 @@
|
||||
|
||||
[/Script/EngineSettings.GeneralProjectSettings]
|
||||
ProjectID=89BAE1A442C4C9FCD7AD2485E27B7402
|
||||
ProjectName=Wailing
|
||||
ProjectVersion=0.1.0.0
|
||||
CompanyName=Amasson
|
||||
CopyrightNotice=Copyright by amasson
|
||||
ProjectDisplayedTitle=NSLOCTEXT("[/Script/EngineSettings]", "AFE249BB43CD5968FD752A8C670A4804", "{GameName}")
|
||||
|
||||
[StartupActions]
|
||||
bAddPacks=True
|
||||
InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent")
|
||||
|
||||
[/Script/GameplayAbilities.AbilitySystemGlobals]
|
||||
AbilitySystemGlobalsClassName="/Script/GasRpg.GasRpgAbilitySystemGlobals"
|
||||
|
||||
@@ -77,7 +77,7 @@ DefaultViewportMouseLockMode=LockOnCapture
|
||||
FOVScale=0.011110
|
||||
DoubleClickTime=0.200000
|
||||
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
|
||||
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
|
||||
DefaultInputComponentClass=/Script/GasRpg.GRInputComponent
|
||||
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
|
||||
-ConsoleKeys=Tilde
|
||||
+ConsoleKeys=Tilde
|
||||
|
||||
Binary file not shown.
BIN
Content/Wailing/Blueprints/Animations/ABP_Aura.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Animations/ABP_Aura.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Animations/ABP_GoblinSlingshot.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Animations/ABP_GoblinSlingshot.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Animations/ABP_GoblinSpear.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Animations/ABP_GoblinSpear.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Animations/ABP_TopDownCharacterTemplate.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Animations/ABP_TopDownCharacterTemplate.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Character/BP_WLCharacterBaseComponent.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Character/BP_WLCharacterBaseComponent.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Character/NPC/BP_NpcCharacterBase.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Character/NPC/BP_NpcCharacterBase.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Character/Player/BP_Aura.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Character/Player/BP_Aura.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Character/Player/BP_PlayerCharacterBase.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Character/Player/BP_PlayerCharacterBase.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Game/GM_Wailing.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Game/GM_Wailing.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Game/GS_Wailing.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Game/GS_Wailing.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Player/HUD_Wailing.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Player/HUD_Wailing.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Player/PC_Wailing.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Player/PC_Wailing.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Player/PC_Wailing2.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Player/PC_Wailing2.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Blueprints/Player/PS_Wailing.uasset
LFS
Normal file
BIN
Content/Wailing/Blueprints/Player/PS_Wailing.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Data/Character/Kits/CK_Base.uasset
LFS
Normal file
BIN
Content/Wailing/Data/Character/Kits/CK_Base.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Input/Actions/AI_AutoRun.uasset
LFS
Normal file
BIN
Content/Wailing/Input/Actions/AI_AutoRun.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Input/Actions/AI_HoldPosition.uasset
LFS
Normal file
BIN
Content/Wailing/Input/Actions/AI_HoldPosition.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Input/Actions/AI_Move.uasset
LFS
Normal file
BIN
Content/Wailing/Input/Actions/AI_Move.uasset
LFS
Normal file
Binary file not shown.
BIN
Content/Wailing/Input/IMC_Default.uasset
LFS
Normal file
BIN
Content/Wailing/Input/IMC_Default.uasset
LFS
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
Plugins/FactionSystem
Submodule
1
Plugins/FactionSystem
Submodule
Submodule Plugins/FactionSystem added at 8e997faa0e
1
Plugins/GasRpg
Submodule
1
Plugins/GasRpg
Submodule
Submodule Plugins/GasRpg added at f313afb1fc
1
Plugins/SlotBasedInventorySystem
Submodule
1
Plugins/SlotBasedInventorySystem
Submodule
Submodule Plugins/SlotBasedInventorySystem added at b4b42bea10
@@ -8,8 +8,8 @@ public class WailingTarget : TargetRules
|
||||
public WailingTarget(TargetInfo Target) : base(Target)
|
||||
{
|
||||
Type = TargetType.Game;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V4;
|
||||
|
||||
ExtraModuleNames.AddRange( new string[] { "Wailing" } );
|
||||
DefaultBuildSettings = BuildSettingsVersion.V5;
|
||||
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
|
||||
ExtraModuleNames.Add("Wailing");
|
||||
}
|
||||
}
|
||||
|
||||
106
Source/Wailing/Private/Components/AutoRunComponent.cpp
Normal file
106
Source/Wailing/Private/Components/AutoRunComponent.cpp
Normal file
@@ -0,0 +1,106 @@
|
||||
// Amasson
|
||||
|
||||
|
||||
#include "Components/AutoRunComponent.h"
|
||||
#include "Components/SplineComponent.h"
|
||||
#include "NavigationSystem.h"
|
||||
#include "NavigationPath.h"
|
||||
|
||||
|
||||
UAutoRunComponent::UAutoRunComponent()
|
||||
{
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
|
||||
PathSpline = CreateDefaultSubobject<USplineComponent>("PathSpline");
|
||||
}
|
||||
|
||||
void UAutoRunComponent::SetControlledPawn(APawn* Pawn)
|
||||
{
|
||||
ControlledPawn = Pawn;
|
||||
}
|
||||
|
||||
void UAutoRunComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
if (bAutoRunning)
|
||||
if (IsValid(ControlledPawn) && IsValid(PathSpline))
|
||||
{
|
||||
const FVector PawnLocation = ControlledPawn->GetActorLocation();
|
||||
const float ClosePointKey = PathSpline->FindInputKeyClosestToWorldLocation(PawnLocation);
|
||||
const FVector LocationOnSpline = PathSpline->GetLocationAtSplineInputKey(ClosePointKey, ESplineCoordinateSpace::World);
|
||||
const FVector SplineDirection = PathSpline->GetDirectionAtSplineInputKey(ClosePointKey, ESplineCoordinateSpace::World);
|
||||
const FVector NextTargetPoint = PathSpline->GetLocationAtSplineInputKey(FMath::CeilToFloat(ClosePointKey + 0.5), ESplineCoordinateSpace::World);
|
||||
FVector DirectionToNextTargetPoint = NextTargetPoint - PawnLocation;
|
||||
|
||||
DirectionToNextTargetPoint.Normalize();
|
||||
|
||||
ControlledPawn->AddMovementInput((SplineDirection + DirectionToNextTargetPoint) / 2);
|
||||
|
||||
if (ClosePointKey >= static_cast<float>(PathSpline->GetNumberOfSplinePoints()) - 1.1)
|
||||
bAutoRunning = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void UAutoRunComponent::StopAutoRun()
|
||||
{
|
||||
bAutoRunning = false;
|
||||
}
|
||||
|
||||
void UAutoRunComponent::AutoRunKeyPressed()
|
||||
{
|
||||
FollowTime = 0;
|
||||
bAutoRunning = false;
|
||||
}
|
||||
|
||||
void UAutoRunComponent::AutoRunKeyReleased()
|
||||
{
|
||||
if (!IsValid(ControlledPawn))
|
||||
return;
|
||||
|
||||
if (FollowTime < ShortPressThreshold)
|
||||
{
|
||||
if (UNavigationPath* NavPath = UNavigationSystemV1::FindPathToLocationSynchronously(this, ControlledPawn->GetActorLocation(), CachedDestination))
|
||||
{
|
||||
if (IsValid(PathSpline))
|
||||
{
|
||||
PathSpline->ClearSplinePoints();
|
||||
for (const FVector& PointLoc : NavPath->PathPoints)
|
||||
{
|
||||
PathSpline->AddSplinePoint(PointLoc, ESplineCoordinateSpace::World);
|
||||
}
|
||||
}
|
||||
if (!NavPath->PathPoints.IsEmpty())
|
||||
CachedDestination = NavPath->PathPoints[NavPath->PathPoints.Num() - 1];
|
||||
OnAutoWalkBegin.Broadcast(this, CachedDestination);
|
||||
bAutoRunning = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UAutoRunComponent::AutoRunKeyHold(float DeltaTime, const FHitResult& CursorHit)
|
||||
{
|
||||
FollowTime += DeltaTime;
|
||||
|
||||
if (CursorHit.bBlockingHit)
|
||||
{
|
||||
CachedDestination = CursorHit.ImpactPoint;
|
||||
if (IsValid(ControlledPawn))
|
||||
{
|
||||
const FVector WorldDirection = (CachedDestination - ControlledPawn->GetActorLocation()).GetSafeNormal();
|
||||
ControlledPawn->AddMovementInput(WorldDirection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool UAutoRunComponent::IsAtDestination() const
|
||||
{
|
||||
if (!IsValid(ControlledPawn))
|
||||
return false;
|
||||
|
||||
const float SquaredDistanceToDestination = (ControlledPawn->GetActorLocation() - CachedDestination).SquaredLength();
|
||||
const float SquaredAcceptanceRadius = AutoRunAcceptanceRadius * AutoRunAcceptanceRadius;
|
||||
|
||||
return SquaredDistanceToDestination <= SquaredAcceptanceRadius;
|
||||
}
|
||||
5
Source/Wailing/Private/Data/WLCharacterKit.cpp
Normal file
5
Source/Wailing/Private/Data/WLCharacterKit.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
// Copyright by amasson
|
||||
|
||||
|
||||
#include "Data/WLCharacterKit.h"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "MyClass.h"
|
||||
|
||||
MyClass::MyClass()
|
||||
{
|
||||
}
|
||||
|
||||
MyClass::~MyClass()
|
||||
{
|
||||
}
|
||||
103
Source/Wailing/Private/Player/WLPlayerController.cpp
Normal file
103
Source/Wailing/Private/Player/WLPlayerController.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
// Copyright by amasson
|
||||
|
||||
|
||||
#include "Player/WLPlayerController.h"
|
||||
#include "Components/InteractionControllerComponent.h"
|
||||
#include "Components/AutoRunComponent.h"
|
||||
#include "EnhancedInputSubsystems.h"
|
||||
#include "EnhancedInputComponent.h"
|
||||
|
||||
|
||||
AWLPlayerController::AWLPlayerController()
|
||||
{
|
||||
InteractionComponent = CreateDefaultSubobject<UInteractionControllerComponent>("InteractionComponent");
|
||||
AutoRunComponent = CreateDefaultSubobject<UAutoRunComponent>("AutoRunComponent");
|
||||
|
||||
bShowMouseCursor = true;
|
||||
DefaultMouseCursor = EMouseCursor::Default;
|
||||
}
|
||||
|
||||
void AWLPlayerController::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
if (UEnhancedInputLocalPlayerSubsystem* InputSubsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
|
||||
{
|
||||
checkf(InputContext, TEXT("WLPlayerController: Invalid Input Context"));
|
||||
InputSubsystem->AddMappingContext(InputContext, 0);
|
||||
}
|
||||
|
||||
FInputModeGameAndUI InputModeData;
|
||||
InputModeData.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock);
|
||||
InputModeData.SetHideCursorDuringCapture(false);
|
||||
SetInputMode(InputModeData);
|
||||
}
|
||||
|
||||
void AWLPlayerController::AcknowledgePossession(APawn* P)
|
||||
{
|
||||
Super::AcknowledgePossession(P);
|
||||
|
||||
AutoRunComponent->SetControlledPawn(P);
|
||||
}
|
||||
|
||||
void AWLPlayerController::SetupInputComponent()
|
||||
{
|
||||
Super::SetupInputComponent();
|
||||
|
||||
if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(InputComponent))
|
||||
{
|
||||
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ThisClass::Move);
|
||||
EnhancedInputComponent->BindAction(HoldPositionAction, ETriggerEvent::Triggered, this, &ThisClass::HoldPositionPressed);
|
||||
EnhancedInputComponent->BindAction(HoldPositionAction, ETriggerEvent::Completed, this, &ThisClass::HoldPositionReleased);
|
||||
EnhancedInputComponent->BindAction(AutoRunAction, ETriggerEvent::Started, this, &ThisClass::AutoRunPressed);
|
||||
EnhancedInputComponent->BindAction(AutoRunAction, ETriggerEvent::Triggered, this, &ThisClass::AutoRunHeld);
|
||||
EnhancedInputComponent->BindAction(AutoRunAction, ETriggerEvent::Completed, this, &ThisClass::AutoRunReleased);
|
||||
}
|
||||
}
|
||||
|
||||
void AWLPlayerController::Move(const FInputActionValue& InputActionValue)
|
||||
{
|
||||
const FVector2D InputAxisVector = InputActionValue.Get<FVector2D>();
|
||||
|
||||
if (InputAxisVector.IsNearlyZero())
|
||||
return;
|
||||
|
||||
AutoRunComponent->StopAutoRun();
|
||||
const FRotator Rotation = GetControlRotation();
|
||||
const FRotator YawRotation(0.0f, Rotation.Yaw, 0.0f);
|
||||
const FRotationMatrix RotationMatrix(YawRotation);
|
||||
|
||||
const FVector ForwardVector = RotationMatrix.GetUnitAxis(EAxis::X);
|
||||
const FVector RightVector = RotationMatrix.GetUnitAxis(EAxis::Y);
|
||||
|
||||
if (APawn* ControlledPawn = GetPawn<APawn>())
|
||||
{
|
||||
ControlledPawn->AddMovementInput(ForwardVector, InputAxisVector.Y);
|
||||
ControlledPawn->AddMovementInput(RightVector, InputAxisVector.X);
|
||||
}
|
||||
}
|
||||
|
||||
void AWLPlayerController::AutoRunPressed()
|
||||
{
|
||||
AutoRunComponent->AutoRunKeyPressed();
|
||||
}
|
||||
|
||||
void AWLPlayerController::AutoRunHeld()
|
||||
{
|
||||
AutoRunComponent->AutoRunKeyHold(GetWorld()->GetDeltaSeconds(), InteractionComponent->GetCursorHit());
|
||||
}
|
||||
|
||||
void AWLPlayerController::AutoRunReleased()
|
||||
{
|
||||
AutoRunComponent->AutoRunKeyReleased();
|
||||
}
|
||||
|
||||
void AWLPlayerController::HoldPositionPressed()
|
||||
{
|
||||
AutoRunComponent->HoldPositionPressed();
|
||||
}
|
||||
|
||||
void AWLPlayerController::HoldPositionReleased()
|
||||
{
|
||||
AutoRunComponent->HoldPositionReleased();
|
||||
}
|
||||
73
Source/Wailing/Public/Components/AutoRunComponent.h
Normal file
73
Source/Wailing/Public/Components/AutoRunComponent.h
Normal file
@@ -0,0 +1,73 @@
|
||||
// Amasson
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/ActorComponent.h"
|
||||
#include "AutoRunComponent.generated.h"
|
||||
|
||||
class USplineComponent;
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnAutoWalkBeginSignature, UAutoRunComponent*, AutoRunComponent, FVector, Destination);
|
||||
|
||||
|
||||
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
||||
class WAILING_API UAutoRunComponent : public UActorComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UAutoRunComponent();
|
||||
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnAutoWalkBeginSignature OnAutoWalkBegin;
|
||||
|
||||
void SetControlledPawn(APawn* Pawn);
|
||||
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
void StopAutoRun();
|
||||
|
||||
void AutoRunKeyPressed();
|
||||
void AutoRunKeyReleased();
|
||||
void AutoRunKeyHold(float DeltaTime, const FHitResult& CursorHit);
|
||||
|
||||
void HoldPositionPressed()
|
||||
{
|
||||
bIsHoldingPosition = true;
|
||||
}
|
||||
|
||||
void HoldPositionReleased()
|
||||
{
|
||||
bIsHoldingPosition = false;
|
||||
}
|
||||
|
||||
bool ShouldAutoRun()
|
||||
{
|
||||
return !bIsHoldingPosition;
|
||||
}
|
||||
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Components")
|
||||
USplineComponent* GetPathSpline() const { return PathSpline; }
|
||||
|
||||
private:
|
||||
|
||||
FVector CachedDestination = FVector::ZeroVector;
|
||||
float FollowTime = 0.0f;
|
||||
float ShortPressThreshold = 0.2f;
|
||||
bool bAutoRunning = false;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
float AutoRunAcceptanceRadius = 50.0f;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
TObjectPtr<USplineComponent> PathSpline;
|
||||
|
||||
TObjectPtr<APawn> ControlledPawn;
|
||||
|
||||
bool bIsHoldingPosition;
|
||||
|
||||
bool IsAtDestination() const;
|
||||
|
||||
};
|
||||
18
Source/Wailing/Public/Data/WLCharacterKit.h
Normal file
18
Source/Wailing/Public/Data/WLCharacterKit.h
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright by amasson
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Data/GRCharacterKit.h"
|
||||
#include "WLCharacterKit.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class WAILING_API UWLCharacterKit : public UGRCharacterKit
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
};
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class WAILING_API MyClass
|
||||
{
|
||||
public:
|
||||
MyClass();
|
||||
~MyClass();
|
||||
};
|
||||
60
Source/Wailing/Public/Player/WLPlayerController.h
Normal file
60
Source/Wailing/Public/Player/WLPlayerController.h
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright by amasson
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Player/GRPlayerController.h"
|
||||
#include "WLPlayerController.generated.h"
|
||||
|
||||
class UInputAction;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class WAILING_API AWLPlayerController : public AGRPlayerController
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
protected:
|
||||
|
||||
AWLPlayerController();
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
virtual void AcknowledgePossession(APawn* P) override;
|
||||
|
||||
virtual void SetupInputComponent() override;
|
||||
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = true))
|
||||
TObjectPtr<class UInteractionControllerComponent> InteractionComponent;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "AutoRun", meta = (AllowPrivateAccess = true))
|
||||
TObjectPtr<class UAutoRunComponent> AutoRunComponent;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Input")
|
||||
TObjectPtr<class UInputMappingContext> InputContext;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Input")
|
||||
TObjectPtr<UInputAction> MoveAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Input")
|
||||
TObjectPtr<UInputAction> HoldPositionAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Input")
|
||||
TObjectPtr<UInputAction> AutoRunAction;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
void Move(const struct FInputActionValue& InputActionValue);
|
||||
|
||||
void AutoRunPressed();
|
||||
void AutoRunHeld();
|
||||
void AutoRunReleased();
|
||||
|
||||
void HoldPositionPressed();
|
||||
void HoldPositionReleased();
|
||||
|
||||
};
|
||||
@@ -10,7 +10,14 @@ public class Wailing : ModuleRules
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
PrivateDependencyModuleNames.AddRange(new string[] {
|
||||
"AIModule",
|
||||
"EnhancedInput",
|
||||
"FactionSystem",
|
||||
"GasRpg",
|
||||
"NavigationSystem",
|
||||
"InteractionSystem",
|
||||
});
|
||||
|
||||
// Uncomment if you are using Slate UI
|
||||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||
|
||||
@@ -8,8 +8,8 @@ public class WailingEditorTarget : TargetRules
|
||||
public WailingEditorTarget(TargetInfo Target) : base(Target)
|
||||
{
|
||||
Type = TargetType.Editor;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V4;
|
||||
|
||||
ExtraModuleNames.AddRange( new string[] { "Wailing" } );
|
||||
DefaultBuildSettings = BuildSettingsVersion.V5;
|
||||
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
|
||||
ExtraModuleNames.Add("Wailing");
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Wailing.png
LFS
Normal file
BIN
Wailing.png
LFS
Normal file
Binary file not shown.
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"FileVersion": 3,
|
||||
"EngineAssociation": "5.3",
|
||||
"EngineAssociation": "5.4",
|
||||
"Category": "",
|
||||
"Description": "",
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "Wailing",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default"
|
||||
"LoadingPhase": "Default",
|
||||
"AdditionalDependencies": [
|
||||
"GasRpg"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Plugins": [
|
||||
@@ -17,6 +20,10 @@
|
||||
"TargetAllowList": [
|
||||
"Editor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "FunctionalTestingEditor",
|
||||
"Enabled": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user