Compare commits

..

2 Commits

Author SHA1 Message Date
6ca0f21163 修复bug 2026-04-26 18:49:19 +08:00
88d01f588b Remove redundant SLS movement bridge 2026-04-26 18:13:19 +08:00
22 changed files with 209 additions and 367 deletions

View File

@@ -159,3 +159,15 @@ ManualIPAddress=
+CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle") +CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
+CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn") +CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")
[/Script/GameplayDebugger.GameplayDebuggerConfig]
CategorySlot0=F10
CategorySlot1=F1
CategorySlot2=F2
CategorySlot3=F3
CategorySlot4=F4
CategorySlot5=F5
CategorySlot6=F6
CategorySlot7=F7
CategorySlot8=F8
CategorySlot9=F9

View File

@@ -1,9 +1,9 @@
[/Script/PHY.PHYAnimationSettings] [/Script/PHY.PHYAnimationSettings]
DefaultSourceLocomotionMesh="/Game/AGame/Character/Locomotion/SKM_Quinn_Simple_Source.SKM_Quinn_Simple_Source" DefaultSourceLocomotionMesh="/Game/AGame/Character/SKM_Manny_Invis.SKM_Manny_Invis"
DefaultSourceAnimClass="/Game/AGame/Animation/Locomotion/ABP_UE5_Main.ABP_UE5_Main_C" DefaultSourceAnimClass="/Game/AGame/Animation/Locomotion/ABP_UE5_Main.ABP_UE5_Main_C"
DefaultDisplayAnimClass="/Game/AGame/Animation/Retargeters/ABP_Retargeter.ABP_Retargeter_C" DefaultDisplayAnimClass="/Game/AGame/Animation/Retargeters/ABP_Retargeter.ABP_Retargeter_C"
DefaultIKRetargeter="/Game/AGame/Animation/Retargeters/RTG_Manny_To_Ida.RTG_Manny_To_Ida" DefaultIKRetargeter="/Game/AGame/Animation/Retargeters/RTG_Manny_To_Ida.RTG_Manny_To_Ida"
bHideSourceMeshInGame=True bHideSourceMeshInGame=False
bPreferLeaderPoseForSameSkeleton=True bPreferLeaderPoseForSameSkeleton=True
bAllowRuntimeVisualMeshSwitch=True bAllowRuntimeVisualMeshSwitch=True
bApplyPlayerClassMeshToAI=False bApplyPlayerClassMeshToAI=False

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -11,6 +11,10 @@
} }
], ],
"Plugins": [ "Plugins": [
{
"Name": "PythonScriptPlugin",
"Enabled": true
},
{ {
"Name": "ModelingToolsEditorMode", "Name": "ModelingToolsEditorMode",
"Enabled": true, "Enabled": true,
@@ -57,6 +61,22 @@
"SupportedTargetPlatforms": [ "SupportedTargetPlatforms": [
"Win64" "Win64"
] ]
},
{
"Name": "UE_MCP_Bridge",
"Enabled": true
},
{
"Name": "Niagara",
"Enabled": true
},
{
"Name": "PCG",
"Enabled": true
},
{
"Name": "EnhancedInput",
"Enabled": true
} }
] ]
} }

View File

@@ -1,7 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "Camera/PHYUGCSpringArmComponent.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(PHYUGCSpringArmComponent)
// 当前包装层只解除抽象限制,后续相机专家可在这里集中扩展 UGC 项目逻辑。

View File

@@ -17,8 +17,8 @@
#include "GGA_AbilitySystemComponent.h" #include "GGA_AbilitySystemComponent.h"
#include "GameFramework/CharacterMovementComponent.h" #include "GameFramework/CharacterMovementComponent.h"
#include "Interaction/GGS_InteractionSystemComponent.h" #include "Interaction/GGS_InteractionSystemComponent.h"
#include "Locomotion/PHYSLSMovementBridgeComponent.h"
#include "Net/UnrealNetwork.h" #include "Net/UnrealNetwork.h"
#include "PHYConfigSettings.h"
#include "PHYGameplayTags.h" #include "PHYGameplayTags.h"
#include "Ragdoll/GGS_RagdollComponent.h" #include "Ragdoll/GGS_RagdollComponent.h"
#include "Components/SLSCharacterMovementComponent.h" #include "Components/SLSCharacterMovementComponent.h"
@@ -27,6 +27,24 @@
#include "Targeting/GCS_TargetingSystemComponent.h" #include "Targeting/GCS_TargetingSystemComponent.h"
#include "Team/GCS_CombatTeamAgentComponent.h" #include "Team/GCS_CombatTeamAgentComponent.h"
namespace
{
ESLSRotationMode GetSLSRotationMode(const FGameplayTag NewRotationMode)
{
if (NewRotationMode == PHYGameplayTags::State_Rotation_Looking)
{
return ESLSRotationMode::LookingDirection;
}
if (NewRotationMode == PHYGameplayTags::State_Rotation_Aiming)
{
return ESLSRotationMode::AimingDirection;
}
return ESLSRotationMode::VelocityDirection;
}
}
APHYCharacterBase::APHYCharacterBase(const FObjectInitializer& ObjectInitializer) APHYCharacterBase::APHYCharacterBase(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer.SetDefaultSubobjectClass<USLSCharacterMovementComponent>(ACharacter::CharacterMovementComponentName)) : Super(ObjectInitializer.SetDefaultSubobjectClass<USLSCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))
{ {
@@ -47,7 +65,6 @@ APHYCharacterBase::APHYCharacterBase(const FObjectInitializer& ObjectInitializer
RagdollComponent = CreateDefaultSubobject<UGGS_RagdollComponent>(TEXT("RagdollComponent")); RagdollComponent = CreateDefaultSubobject<UGGS_RagdollComponent>(TEXT("RagdollComponent"));
ContextEffectComponent = CreateDefaultSubobject<UGES_ContextEffectComponent>(TEXT("ContextEffectComponent")); ContextEffectComponent = CreateDefaultSubobject<UGES_ContextEffectComponent>(TEXT("ContextEffectComponent"));
MeshBridgeComponent = CreateDefaultSubobject<UPHYCharacterMeshBridgeComponent>(TEXT("MeshBridgeComponent")); MeshBridgeComponent = CreateDefaultSubobject<UPHYCharacterMeshBridgeComponent>(TEXT("MeshBridgeComponent"));
SLSMovementBridgeComponent = CreateDefaultSubobject<UPHYSLSMovementBridgeComponent>(TEXT("SLSMovementBridgeComponent"));
SLSIntegrationComponent = CreateDefaultSubobject<USLSIntegrationComponent>(TEXT("SLSIntegrationComponent")); SLSIntegrationComponent = CreateDefaultSubobject<USLSIntegrationComponent>(TEXT("SLSIntegrationComponent"));
USLSIntegrationDataAsset* SLSIntegrationRuntimeDataAsset = CreateDefaultSubobject<USLSIntegrationDataAsset>(TEXT("SLSIntegrationRuntimeDataAsset")); USLSIntegrationDataAsset* SLSIntegrationRuntimeDataAsset = CreateDefaultSubobject<USLSIntegrationDataAsset>(TEXT("SLSIntegrationRuntimeDataAsset"));
@@ -126,9 +143,20 @@ void APHYCharacterBase::BeginPlay()
ContextEffectComponent->SetGameplayTagsProvider(this); ContextEffectComponent->SetGameplayTagsProvider(this);
} }
if (SLSMovementBridgeComponent) if (const UPHYLocomotionSettings* LocomotionSettings = GetDefault<UPHYLocomotionSettings>(); LocomotionSettings && LocomotionSettings->bUseSmoothLocomotionSystem)
{ {
SLSMovementBridgeComponent->InitializeSLSMovementBridge(this, GenericIntegrationComponent, SLSIntegrationComponent); if (USLSCharacterMovementComponent* SLSMovementComponent = GetSLSCharacterMovementComponent())
{
const UPHYCharacterSettings* CharacterSettings = GetDefault<UPHYCharacterSettings>();
SLSMovementComponent->ApplyBaseSLSCharacterMovementSettings();
SLSMovementComponent->MaxWalkSpeed = CharacterSettings ? CharacterSettings->DefaultMaxWalkSpeed : SLSMovementComponent->MaxWalkSpeed;
SLSMovementComponent->MaxAcceleration = CharacterSettings ? CharacterSettings->DefaultMaxAcceleration : SLSMovementComponent->MaxAcceleration;
}
}
if (CharacterStateComponent)
{
SetRotationMode_Implementation(CharacterStateComponent->GetRotationMode());
} }
UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(this, UGameFrameworkComponentManager::NAME_GameActorReady); UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(this, UGameFrameworkComponentManager::NAME_GameActorReady);
@@ -263,15 +291,10 @@ bool APHYCharacterBase::HandleInputTag(const FGameplayTag InputTag, const ETrigg
if (InputTag == PHYGameplayTags::Input_Aim) if (InputTag == PHYGameplayTags::Input_Aim)
{ {
if (USLSCharacterMovementComponent* SLSMovementComponent = GetSLSCharacterMovementComponent()) SetRotationMode_Implementation(bPressed ? PHYGameplayTags::State_Rotation_Aiming : PHYGameplayTags::State_Rotation_OrientToMovement);
{
SLSMovementComponent->UpdateRotationMode(bPressed ? ESLSRotationMode::AimingDirection : ESLSRotationMode::VelocityDirection);
}
if (CharacterStateComponent) if (CharacterStateComponent)
{ {
CharacterStateComponent->SetMovementSet(bPressed ? PHYGameplayTags::State_MovementSet_Aiming : PHYGameplayTags::State_MovementSet_Default); CharacterStateComponent->SetMovementSet(bPressed ? PHYGameplayTags::State_MovementSet_Aiming : PHYGameplayTags::State_MovementSet_Default);
CharacterStateComponent->SetRotationMode(bPressed ? PHYGameplayTags::State_Rotation_Strafe : PHYGameplayTags::State_Rotation_OrientToMovement);
} }
return true; return true;
@@ -484,6 +507,11 @@ void APHYCharacterBase::SetRotationMode_Implementation(const FGameplayTag NewRot
{ {
CharacterStateComponent->SetRotationMode(NewRotationMode); CharacterStateComponent->SetRotationMode(NewRotationMode);
} }
if (USLSCharacterMovementComponent* SLSMovementComponent = GetSLSCharacterMovementComponent())
{
SLSMovementComponent->UpdateRotationMode(GetSLSRotationMode(NewRotationMode));
}
} }
FGameplayTag APHYCharacterBase::GetRotationMode_Implementation() const FGameplayTag APHYCharacterBase::GetRotationMode_Implementation() const

View File

@@ -5,7 +5,6 @@
#include UE_INLINE_GENERATED_CPP_BY_NAME(PHYPlayerCharacter) #include UE_INLINE_GENERATED_CPP_BY_NAME(PHYPlayerCharacter)
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "Camera/PHYUGCSpringArmComponent.h"
#include "Class/PHYClassComponent.h" #include "Class/PHYClassComponent.h"
#include "GameFramework/SpringArmComponent.h" #include "GameFramework/SpringArmComponent.h"
#include "GIPS_InputSystemComponent.h" #include "GIPS_InputSystemComponent.h"
@@ -16,7 +15,7 @@ APHYPlayerCharacter::APHYPlayerCharacter(const FObjectInitializer& ObjectInitial
{ {
InputSystemComponent = CreateDefaultSubobject<UGIPS_InputSystemComponent>(TEXT("InputSystemComponent")); InputSystemComponent = CreateDefaultSubobject<UGIPS_InputSystemComponent>(TEXT("InputSystemComponent"));
CameraBoom = CreateDefaultSubobject<UPHYUGCSpringArmComponent>(TEXT("CameraBoom")); CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
CameraBoom->SetupAttachment(GetRootComponent()); CameraBoom->SetupAttachment(GetRootComponent());
CameraBoom->TargetArmLength = 320.0f; CameraBoom->TargetArmLength = 320.0f;
CameraBoom->bUsePawnControlRotation = true; CameraBoom->bUsePawnControlRotation = true;

View File

@@ -18,5 +18,6 @@ namespace PHYGameplayTags
UE_DEFINE_GAMEPLAY_TAG(State_MovementSet_Default, "State.MovementSet.Default"); UE_DEFINE_GAMEPLAY_TAG(State_MovementSet_Default, "State.MovementSet.Default");
UE_DEFINE_GAMEPLAY_TAG(State_MovementSet_Aiming, "State.MovementSet.Aiming"); UE_DEFINE_GAMEPLAY_TAG(State_MovementSet_Aiming, "State.MovementSet.Aiming");
UE_DEFINE_GAMEPLAY_TAG(State_Rotation_OrientToMovement, "State.Rotation.OrientToMovement"); UE_DEFINE_GAMEPLAY_TAG(State_Rotation_OrientToMovement, "State.Rotation.OrientToMovement");
UE_DEFINE_GAMEPLAY_TAG(State_Rotation_Strafe, "State.Rotation.Strafe"); UE_DEFINE_GAMEPLAY_TAG(State_Rotation_Looking, "State.Rotation.Looking");
UE_DEFINE_GAMEPLAY_TAG(State_Rotation_Aiming, "State.Rotation.Aiming");
} }

View File

@@ -1,107 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "Locomotion/PHYSLSMovementBridgeComponent.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(PHYSLSMovementBridgeComponent)
#include "Characters/PHYCharacterBase.h"
#include "Characters/PHYCharacterSettings.h"
#include "Components/SLSCharacterMovementComponent.h"
#include "GameFramework/Character.h"
#include "PHYConfigSettings.h"
#include "SLSIntegrationComponent.h"
UPHYSLSMovementBridgeComponent::UPHYSLSMovementBridgeComponent()
{
PrimaryComponentTick.bCanEverTick = false;
SetIsReplicatedByDefault(false);
}
bool UPHYSLSMovementBridgeComponent::InitializeSLSMovementBridge(ACharacter* InCharacter, UActorComponent* InGenericIntegrationComponent, USLSIntegrationComponent* InSLSIntegrationComponent)
{
bInitialized = false;
OwnerCharacter = InCharacter;
GenericIntegrationComponent = InGenericIntegrationComponent;
SLSIntegrationComponent = InSLSIntegrationComponent;
SLSCharacterMovementComponent = nullptr;
const UPHYLocomotionSettings* LocomotionSettings = GetDefault<UPHYLocomotionSettings>();
if (!LocomotionSettings || !LocomotionSettings->bUseSmoothLocomotionSystem || !OwnerCharacter)
{
return false;
}
SLSCharacterMovementComponent = Cast<USLSCharacterMovementComponent>(OwnerCharacter->GetCharacterMovement());
if (!SLSCharacterMovementComponent)
{
return false;
}
if (!SLSIntegrationComponent)
{
SLSIntegrationComponent = OwnerCharacter->FindComponentByClass<USLSIntegrationComponent>();
}
const UPHYCharacterSettings* CharacterSettings = GetDefault<UPHYCharacterSettings>();
// 项目侧保留显式初始化SLSIntegrationComponent 只作为运动层集中集成入口。
SLSCharacterMovementComponent->Config.InitComponentType = ESLSComponentInitType::ManualInit;
SLSCharacterMovementComponent->Config.MovementType = ESLSMovementType::Jog;
SLSCharacterMovementComponent->Config.RotationMode = ESLSRotationMode::VelocityDirection;
SLSCharacterMovementComponent->Config.bEnableSprintInLookingDirectionRotationMode = true;
SLSCharacterMovementComponent->ApplyBaseSLSCharacterMovementSettings();
if (CharacterSettings)
{
SLSCharacterMovementComponent->MaxWalkSpeed = CharacterSettings->DefaultMaxWalkSpeed;
SLSCharacterMovementComponent->MaxAcceleration = CharacterSettings->DefaultMaxAcceleration;
}
SLSCharacterMovementComponent->InitializeMovementComponent(SLSCharacterMovementComponent->Config);
bInitialized = true;
return true;
}
bool UPHYSLSMovementBridgeComponent::HandleMoveInput(const FVector2D MoveInput)
{
if (!EnsureSLSMovementBridgeReady())
{
return false;
}
const FRotator YawRotation(0.0f, OwnerCharacter->GetControlRotation().Yaw, 0.0f);
const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
const FVector WorldIntent = (ForwardDirection * MoveInput.Y) + (RightDirection * MoveInput.X);
if (APHYCharacterBase* PHYCharacter = Cast<APHYCharacterBase>(OwnerCharacter))
{
PHYCharacter->SetMovementIntent(WorldIntent);
}
SLSCharacterMovementComponent->Input_OnMove(MoveInput);
return true;
}
bool UPHYSLSMovementBridgeComponent::HandleLookInput(const FVector2D LookInput)
{
if (!EnsureSLSMovementBridgeReady())
{
return false;
}
SLSCharacterMovementComponent->Input_OnLook(LookInput);
return true;
}
bool UPHYSLSMovementBridgeComponent::EnsureSLSMovementBridgeReady()
{
if (bInitialized && OwnerCharacter && SLSCharacterMovementComponent)
{
return true;
}
ACharacter* Character = OwnerCharacter ? OwnerCharacter.Get() : Cast<ACharacter>(GetOwner());
return InitializeSLSMovementBridge(Character, GenericIntegrationComponent, SLSIntegrationComponent);
}

View File

@@ -6,9 +6,9 @@
#include "Characters/PHYPlayerCharacter.h" #include "Characters/PHYPlayerCharacter.h"
#include "Characters/PHYCharacterSettings.h" #include "Characters/PHYCharacterSettings.h"
#include "Components/SLSCharacterMovementComponent.h"
#include "GIPS_InputSystemComponent.h" #include "GIPS_InputSystemComponent.h"
#include "InputActionValue.h" #include "InputActionValue.h"
#include "Locomotion/PHYSLSMovementBridgeComponent.h"
#include "PHYGameplayTags.h" #include "PHYGameplayTags.h"
namespace namespace
@@ -156,8 +156,19 @@ bool APHYPlayerController::HandleMoveInput(const FInputActionInstance& ActionDat
CachedMovementInput = IsInputReleased(TriggerEvent) ? FVector2D::ZeroVector : ExtractAxis2D(ActionData.GetValue()); CachedMovementInput = IsInputReleased(TriggerEvent) ? FVector2D::ZeroVector : ExtractAxis2D(ActionData.GetValue());
UPHYSLSMovementBridgeComponent* SLSMovementBridge = PHYCharacter->GetSLSMovementBridgeComponent(); const FRotator YawRotation(0.0f, PHYCharacter->GetControlRotation().Yaw, 0.0f);
return SLSMovementBridge ? SLSMovementBridge->HandleMoveInput(CachedMovementInput) : false; const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
const FVector WorldIntent = (ForwardDirection * CachedMovementInput.Y) + (RightDirection * CachedMovementInput.X);
PHYCharacter->SetMovementIntent(WorldIntent);
if (USLSCharacterMovementComponent* SLSMovementComponent = PHYCharacter->GetSLSCharacterMovementComponent())
{
SLSMovementComponent->Input_OnMove(CachedMovementInput);
return true;
}
return false;
} }
bool APHYPlayerController::ConsumeMoveProcessorGuard(const ETriggerEvent TriggerEvent) bool APHYPlayerController::ConsumeMoveProcessorGuard(const ETriggerEvent TriggerEvent)
@@ -199,6 +210,11 @@ bool APHYPlayerController::HandleLookInput(const FInputActionInstance& ActionDat
return false; return false;
} }
UPHYSLSMovementBridgeComponent* SLSMovementBridge = PHYCharacter->GetSLSMovementBridgeComponent(); if (USLSCharacterMovementComponent* SLSMovementComponent = PHYCharacter->GetSLSCharacterMovementComponent())
return SLSMovementBridge ? SLSMovementBridge->HandleLookInput(CachedLookInput) : false; {
SLSMovementComponent->Input_OnLook(CachedLookInput);
return true;
}
return false;
} }

View File

@@ -1,18 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Camera/Components/UGC_SpringArmComponentBase.h"
#include "PHYUGCSpringArmComponent.generated.h"
/**
* @brief PHY 对 UGC SpringArm 的项目级可实例化包装。
*
* UGC 基类是抽象组件,项目通过该薄包装在 C++ 构造玩家相机臂。
*/
UCLASS(BlueprintType, Blueprintable, meta=(BlueprintSpawnableComponent))
class PHY_API UPHYUGCSpringArmComponent : public UUGC_SpringArmComponentBase
{
GENERATED_BODY()
};

View File

@@ -19,278 +19,266 @@ class UGGS_InteractionSystemComponent;
class UGGS_RagdollComponent; class UGGS_RagdollComponent;
class UPHYCharacterMeshBridgeComponent; class UPHYCharacterMeshBridgeComponent;
class UPHYCharacterStateComponent; class UPHYCharacterStateComponent;
class UPHYSLSMovementBridgeComponent;
class USkeletalMeshComponent; class USkeletalMeshComponent;
class USLSCharacterMovementComponent; class USLSCharacterMovementComponent;
class USLSIntegrationComponent; class USLSIntegrationComponent;
/** /**
* @brief PHY 玩家和 AI 共用角色基类。 * @brief PHY <EFBFBD>拙振<EFBFBD>?AI <20>梁鍂閫坿𠧧<E59DBF>箇掩<E7AE87>? *
* * <20>箇掩<E7AE87>湔𦻖蝏扳㗁 ACharacter嚗<72><EFBFBD><EFBFBD>憿寧𤌍蝥抒<E89DA5>隞嗅<E99A9E><E59785>亙藁<E4BA99><E89781><EFBFBD> GAS<41><53>CS<43><53>GS<47><53>GC 銝𤾸<E98A9D>蝏剛<E89D8F><E5899B>函頂蝏麄<E89D8F>? */
* 基类直接继承 ACharacter并通过项目级组件和接口适配 GAS、GCS、GGS、UGC 与后续运动系统。
*/
UCLASS(Abstract, BlueprintType, Blueprintable) UCLASS(Abstract, BlueprintType, Blueprintable)
class PHY_API APHYCharacterBase : public ACharacter, public IAbilitySystemInterface, public IGameplayTagAssetInterface, public IGCS_CombatEntityInterface class PHY_API APHYCharacterBase : public ACharacter, public IAbilitySystemInterface, public IGameplayTagAssetInterface, public IGCS_CombatEntityInterface
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/** @brief 构造基础角色组件。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD>惩抅蝖<EFBFBD>閫坿𠧧蝏<EFBFBD><EFBFBD>?*/
APHYCharacterBase(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); APHYCharacterBase(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
/** @brief 注册 ModularGameplay 组件接收者。 */ /** @brief 瘜典<EFBFBD> ModularGameplay <EFBFBD><EFBFBD>交𤣰<EFBFBD><EFBFBD><EFBFBD>?*/
virtual void PreInitializeComponents() override; virtual void PreInitializeComponents() override;
/** @brief Possess PlayerState 初始化前绑定显示层 Mesh 桥接组件。 */ /** @brief <EFBFBD>?Possess <EFBFBD>?PlayerState <EFBFBD><EFBFBD><EFBFBD><EFBFBD>蝏穃<EFBFBD><EFBFBD>曄內撅?Mesh 獢交𦻖蝏<F0A6BB96><EFBFBD>?*/
virtual void PostInitializeComponents() override; virtual void PostInitializeComponents() override;
/** @brief 初始化角色运行时组件。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD>𤥁<EFBFBD><EFBFBD><EFBFBD>銵峕𧒄蝏<EFBFBD><EFBFBD>?*/
virtual void BeginPlay() override; virtual void BeginPlay() override;
/** @brief 移除 ModularGameplay 组件接收者。 */ /** @brief 蝘駁膄 ModularGameplay <EFBFBD><EFBFBD>交𤣰<EFBFBD><EFBFBD><EFBFBD>?*/
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
/** @brief 控制器接管时刷新项目状态。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD>冽𦻖蝞⊥𧒄<EFBFBD>瑟鰵憿寧𤌍<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual void PossessedBy(AController* NewController) override; virtual void PossessedBy(AController* NewController) override;
/** @brief 控制器复制到客户端后刷新项目状态。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>蝡臬<EFBFBD><EFBFBD>瑟鰵憿寧𤌍<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual void OnRep_Controller() override; virtual void OnRep_Controller() override;
/** @brief 获取当前角色使用的 AbilitySystemComponent*/ /** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD>閫坿𠧧雿輻鍂<EFBFBD>?AbilitySystemComponent<EFBFBD>?*/
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
/** @brief 收集 ASC 与角色状态组件提供的 GameplayTag*/ /** @brief <EFBFBD><EFBFBD> ASC 銝舘<EFBFBD><EFBFBD>脩𠶖<EFBFBD><EFBFBD><EFBFBD>隞嗆<EFBFBD>靘𤤿<EFBFBD> GameplayTag<EFBFBD>?*/
virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override; virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override;
/** @brief 初始化当前 Avatar 对应的 ASC*/ /** @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?Avatar 撖孵<EFBFBD><EFBFBD>?ASC<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability") UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability")
virtual void InitializeAbilitySystem(UAbilitySystemComponent* NewAbilitySystemComponent, AActor* OwnerActor); virtual void InitializeAbilitySystem(UAbilitySystemComponent* NewAbilitySystemComponent, AActor* OwnerActor);
/** @brief 清理角色缓存的 ASC 引用。 */ /** @brief <EFBFBD><EFBFBD>閫坿𠧧蝻枏<EFBFBD><EFBFBD>?ASC 撘閧鍂<E996A7>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability") UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability")
virtual void ClearAbilitySystem(); virtual void ClearAbilitySystem();
/** @brief 查询 ASC 是否已经完成项目级初始化。 */ /** @brief <EFBFBD>亥砭 ASC <EFBFBD>臬炏撌脩<EFBFBD>摰峕<EFBFBD>憿寧𤌍蝥批<EFBFBD>憪见<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Ability") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Ability")
bool IsAbilitySystemReady() const { return bAbilitySystemReady; } bool IsAbilitySystemReady() const { return bAbilitySystemReady; }
/** @brief 接收输入 Tag 并路由到移动、交互或 GAS Ability*/ /** @brief <EFBFBD>交𤣰颲枏<EFBFBD> Tag 撟嗉楝<E59789><EFBFBD>蝘餃𢆡<E9A483><F0A286A1>漱鈭埝<E988AD> GAS Ability<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Input") UFUNCTION(BlueprintCallable, Category="PHY|Character|Input")
virtual bool HandleInputTag(FGameplayTag InputTag, ETriggerEvent TriggerEvent); virtual bool HandleInputTag(FGameplayTag InputTag, ETriggerEvent TriggerEvent);
/** @brief 设置移动意图,并在客户端请求服务端同步。 */ /** @brief 霈曄蔭蝘餃𢆡<EFBFBD>誩㦛嚗<EFBFBD><EFBFBD>典恥<EFBFBD>瑞垢霂瑟<EFBFBD><EFBFBD>滚𦛚蝡臬<EFBFBD>甇乓<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Movement") UFUNCTION(BlueprintCallable, Category="PHY|Character|Movement")
virtual void SetMovementIntent(FVector NewMovementIntent); virtual void SetMovementIntent(FVector NewMovementIntent);
/** @brief 设置项目级战斗目标。 */ /** @brief 霈曄蔭憿寧𤌍蝥扳<EFBFBD><EFBFBD>㛖𤌍<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Combat") UFUNCTION(BlueprintCallable, Category="PHY|Character|Combat")
virtual void SetCombatTargetActor(AActor* NewCombatTargetActor); virtual void SetCombatTargetActor(AActor* NewCombatTargetActor);
/** @brief 请求开始交互。 */ /** @brief 霂瑟<EFBFBD><EFBFBD>憪衤漱鈭鉝<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual bool RequestInteraction(int32 OptionIndex = 0); virtual bool RequestInteraction(int32 OptionIndex = 0);
/** @brief 请求一次性即时交互。 */ /** @brief 霂瑟<EFBFBD><EFBFBD>甈⊥<EFBFBD>批朖<EFBFBD>嗡漱鈭鉝<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual bool RequestInstantInteraction(int32 OptionIndex = 0); virtual bool RequestInstantInteraction(int32 OptionIndex = 0);
/** @brief 请求结束当前交互。 */ /** @brief 霂瑟<EFBFBD>蝏𤘪<EFBFBD>敶枏<EFBFBD>鈭支<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual void EndInteraction(); virtual void EndInteraction();
/** @brief 请求切换当前可交互对象。 */ /** @brief 霂瑟<EFBFBD><EFBFBD><EFBFBD>揢敶枏<EFBFBD><EFBFBD>臭漱鈭鍦笆鞊<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual void CycleInteractionTarget(bool bNext); virtual void CycleInteractionTarget(bool bNext);
/** @brief 获取项目角色状态组件。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UPHYCharacterStateComponent* GetCharacterStateComponent() const { return CharacterStateComponent; } UPHYCharacterStateComponent* GetCharacterStateComponent() const { return CharacterStateComponent; }
/** @brief 获取 GCS 战斗组件。 */ /** @brief <EFBFBD><EFBFBD> GCS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGCS_CombatSystemComponent* GetCombatSystemComponent() const { return CombatSystemComponent; } UGCS_CombatSystemComponent* GetCombatSystemComponent() const { return CombatSystemComponent; }
/** @brief 获取 GCS 目标组件。 */ /** @brief <EFBFBD><EFBFBD> GCS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGCS_TargetingSystemComponent* GetTargetingSystemComponent() const { return TargetingSystemComponent; } UGCS_TargetingSystemComponent* GetTargetingSystemComponent() const { return TargetingSystemComponent; }
/** @brief 获取 GGS 交互组件。 */ /** @brief <EFBFBD><EFBFBD> GGS 鈭支<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGGS_InteractionSystemComponent* GetInteractionSystemComponent() const { return InteractionSystemComponent; } UGGS_InteractionSystemComponent* GetInteractionSystemComponent() const { return InteractionSystemComponent; }
/** @brief 获取 GGS 布娃娃组件。 */ /** @brief <EFBFBD><EFBFBD> GGS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGGS_RagdollComponent* GetRagdollComponent() const { return RagdollComponent; } UGGS_RagdollComponent* GetRagdollComponent() const { return RagdollComponent; }
/** @brief 获取上下文效果组件。 */ /** @brief <EFBFBD><EFBFBD>銝𠹺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𦦵<EFBFBD>隞嗚<EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGES_ContextEffectComponent* GetContextEffectComponent() const { return ContextEffectComponent; } UGES_ContextEffectComponent* GetContextEffectComponent() const { return ContextEffectComponent; }
/** @brief 获取角色 Mesh Bridge 组件。 */ /** @brief <EFBFBD><EFBFBD>閫坿𠧧 Mesh Bridge <EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation")
UPHYCharacterMeshBridgeComponent* GetMeshBridgeComponent() const { return MeshBridgeComponent; } UPHYCharacterMeshBridgeComponent* GetMeshBridgeComponent() const { return MeshBridgeComponent; }
/** @brief 获取 PHY SLS 运动桥接组件。 */ /** @brief <EFBFBD><EFBFBD> SLS 閫坿𠧧餈𣂼𢆡蝏<F0A286A1><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion")
UPHYSLSMovementBridgeComponent* GetSLSMovementBridgeComponent() const { return SLSMovementBridgeComponent; }
/** @brief 获取 SLS 角色运动组件。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion")
USLSCharacterMovementComponent* GetSLSCharacterMovementComponent() const; USLSCharacterMovementComponent* GetSLSCharacterMovementComponent() const;
/** @brief 获取 SLS 集成入口组件。 */ /** @brief <EFBFBD><EFBFBD> SLS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>亙藁蝏<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion")
USLSIntegrationComponent* GetSLSIntegrationComponent() const { return SLSIntegrationComponent; } USLSIntegrationComponent* GetSLSIntegrationComponent() const { return SLSIntegrationComponent; }
/** @brief 获取 GenericGameSystem 可选集成入口组件。 */ /** @brief <EFBFBD><EFBFBD> GenericGameSystem <EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣂼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion")
UActorComponent* GetGenericIntegrationComponent() const { return GenericIntegrationComponent; } UActorComponent* GetGenericIntegrationComponent() const { return GenericIntegrationComponent; }
/** @brief 获取显示层 Mesh 组件,职业和外观 Mesh 应应用到该组件。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD>曄內撅?Mesh 蝏<>辣嚗諹<E59A97>銝𡁜<E98A9D>憭𤥁<E686AD> Mesh 摨𥪜<E691A8><F0A5AA9C><EFBFBD>霂亦<E99C82>隞嗚<E99A9E>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation")
USkeletalMeshComponent* GetDisplayMeshComponent() const { return DisplayMeshComponent; } USkeletalMeshComponent* GetDisplayMeshComponent() const { return DisplayMeshComponent; }
/** @brief 获取当前战斗目标 Actor*/ /** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Actor<EFBFBD>?*/
virtual AActor* GetCombatTargetActor_Implementation() const override; virtual AActor* GetCombatTargetActor_Implementation() const override;
/** @brief 获取连击定义表,首期骨架默认不绑定表。 */ /** @brief <EFBFBD><EFBFBD>餈𧼮稬摰帋<EFBFBD>銵剁<EFBFBD>擐𡝗<EFBFBD>撉冽沲暺䁅恕銝滨<EFBFBD>摰朞”<EFBFBD>?*/
virtual const UDataTable* GetComboDefinitionTable_Implementation() const override; virtual const UDataTable* GetComboDefinitionTable_Implementation() const override;
/** @brief 获取当前战斗目标场景对象。 */ /** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>箸艶撖寡情<EFBFBD>?*/
virtual USceneComponent* GetCombatTargetObject_Implementation() const override; virtual USceneComponent* GetCombatTargetObject_Implementation() const override;
/** @brief 查询能力动作,首期骨架默认返回空。 */ /** @brief <EFBFBD>亥砭<EFBFBD><EFBFBD><EFBFBD><EFBFBD>嚗屸<EFBFBD><EFBFBD>罸爸<EFBFBD><EFBFBD>霈方<EFBFBD><EFBFBD>䂿征<EFBFBD>?*/
virtual bool QueryAbilityActions_Implementation(FGameplayTagContainer AbilityTags, FGameplayTagContainer SourceTags, FGameplayTagContainer TargetTags, TArray<FGCS_AbilityAction>& AbilityActions) override; virtual bool QueryAbilityActions_Implementation(FGameplayTagContainer AbilityTags, FGameplayTagContainer SourceTags, FGameplayTagContainer TargetTags, TArray<FGCS_AbilityAction>& AbilityActions) override;
/** @brief 按上下文查询能力动作,首期骨架默认返回空。 */ /** @brief <EFBFBD><EFBFBD>銝𧢲<EFBFBD><EFBFBD>亥砭<EFBFBD><EFBFBD><EFBFBD><EFBFBD>嚗屸<EFBFBD><EFBFBD>罸爸<EFBFBD><EFBFBD>霈方<EFBFBD><EFBFBD>䂿征<EFBFBD>?*/
virtual bool QueryAbilityActionsByContext_Implementation(UObject* Context, FGameplayTagContainer AbilityTags, FGameplayTagContainer SourceTags, FGameplayTagContainer TargetTags, TArray<FGCS_AbilityAction>& AbilityActions) override; virtual bool QueryAbilityActionsByContext_Implementation(UObject* Context, FGameplayTagContainer AbilityTags, FGameplayTagContainer SourceTags, FGameplayTagContainer TargetTags, TArray<FGCS_AbilityAction>& AbilityActions) override;
/** @brief Tag 查询当前武器。 */ /** @brief <EFBFBD>?Tag <EFBFBD>亥砭敶枏<EFBFBD>甇血膥<EFBFBD>?*/
virtual UObject* QueryWeapon_Implementation(const FGameplayTagQuery& Query) const override; virtual UObject* QueryWeapon_Implementation(const FGameplayTagQuery& Query) const override;
/** @brief 设置旋转模式。 */ /** @brief 霈曄蔭<EFBFBD>贝蓮璅<EFBFBD><EFBFBD>?*/
virtual void SetRotationMode_Implementation(FGameplayTag NewRotationMode) override; virtual void SetRotationMode_Implementation(FGameplayTag NewRotationMode) override;
/** @brief 获取旋转模式。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD>贝蓮璅<EFBFBD><EFBFBD>?*/
virtual FGameplayTag GetRotationMode_Implementation() const override; virtual FGameplayTag GetRotationMode_Implementation() const override;
/** @brief 设置移动集合。 */ /** @brief 霈曄蔭蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual void SetMovementSet_Implementation(FGameplayTag NewMovementSet) override; virtual void SetMovementSet_Implementation(FGameplayTag NewMovementSet) override;
/** @brief 获取移动集合。 */ /** @brief <EFBFBD><EFBFBD>蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual FGameplayTag GetMovementSet_Implementation() const override; virtual FGameplayTag GetMovementSet_Implementation() const override;
/** @brief 设置移动状态。 */ /** @brief 霈曄蔭蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual void SetMovementState_Implementation(FGameplayTag NewMovementState) override; virtual void SetMovementState_Implementation(FGameplayTag NewMovementState) override;
/** @brief 获取移动状态。 */ /** @brief <EFBFBD><EFBFBD>蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual FGameplayTag GetMovementState_Implementation() const override; virtual FGameplayTag GetMovementState_Implementation() const override;
/** @brief 开始死亡流程。 */ /** @brief <EFBFBD>憪𧢲香鈭⊥<EFBFBD>蝔卝<EFBFBD>?*/
virtual void StartDeath_Implementation() override; virtual void StartDeath_Implementation() override;
/** @brief 完成死亡流程。 */ /** @brief 摰峕<EFBFBD>甇颱滿瘚<EFBFBD><EFBFBD><EFBFBD>?*/
virtual void FinishDeath_Implementation() override; virtual void FinishDeath_Implementation() override;
/** @brief 查询角色是否死亡。 */ /** @brief <EFBFBD>亥砭閫坿𠧧<EFBFBD>臬炏甇颱滿<EFBFBD>?*/
virtual bool IsDead_Implementation() const override; virtual bool IsDead_Implementation() const override;
/** @brief 获取移动意图。 */ /** @brief <EFBFBD><EFBFBD>蝘餃𢆡<EFBFBD>誩㦛<EFBFBD>?*/
virtual FVector GetMovementIntent_Implementation() const override; virtual FVector GetMovementIntent_Implementation() const override;
/** @brief 获取当前武器。 */ /** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD>甇血膥<EFBFBD>?*/
virtual UObject* GetCurrentWeapon_Implementation(UObject* Context = nullptr) const override; virtual UObject* GetCurrentWeapon_Implementation(UObject* Context = nullptr) const override;
/** @brief 设置当前武器。 */ /** @brief 霈曄蔭敶枏<EFBFBD>甇血膥<EFBFBD>?*/
virtual void SetCurrentWeapon_Implementation(UObject* Weapon) override; virtual void SetCurrentWeapon_Implementation(UObject* Weapon) override;
/** @brief 获取指定 Socket 的相对变换。 */ /** @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Socket <EFBFBD><EFBFBD>㮾撖孵<EFBFBD><EFBFBD><EFBFBD>?*/
virtual bool GetRelativeTransformToSocket_Implementation(const USkeletalMeshComponent* InSkeletalMeshComponent, const UStaticMesh* StaticMesh, const USkeletalMesh* SkeletalMesh, FName SocketName, FTransform& OutTransform) const override; virtual bool GetRelativeTransformToSocket_Implementation(const USkeletalMeshComponent* InSkeletalMeshComponent, const UStaticMesh* StaticMesh, const USkeletalMesh* SkeletalMesh, FName SocketName, FTransform& OutTransform) const override;
protected: protected:
/** @brief 将输入 Tag 映射为 Ability Tag*/ /** @brief <EFBFBD><EFBFBD><EFBFBD>?Tag <20><EFBFBD>銝?Ability Tag<EFBFBD>?*/
virtual FGameplayTag GetAbilityTagForInputTag(FGameplayTag InputTag) const; virtual FGameplayTag GetAbilityTagForInputTag(FGameplayTag InputTag) const;
/** @brief 应用 Character 配置默认值。 */ /** @brief 摨𠉛鍂 Character <EFBFBD>滨蔭暺䁅恕<EFBFBD><EFBFBD>?*/
virtual void ApplyCharacterSettings(); virtual void ApplyCharacterSettings();
/** @brief 服务端同步移动意图。 */ /** @brief <EFBFBD>滚𦛚蝡臬<EFBFBD>甇亦宏<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(Server, Unreliable) UFUNCTION(Server, Unreliable)
void ServerSetMovementIntent(FVector NewMovementIntent); void ServerSetMovementIntent(FVector NewMovementIntent);
/** @brief 服务端设置战斗目标。 */ /** @brief <EFBFBD>滚𦛚蝡航挽蝵格<EFBFBD><EFBFBD>㛖𤌍<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(Server, Reliable) UFUNCTION(Server, Reliable)
void ServerSetCombatTargetActor(AActor* NewCombatTargetActor); void ServerSetCombatTargetActor(AActor* NewCombatTargetActor);
/** @brief 服务端执行开始交互。 */ /** @brief <EFBFBD>滚𦛚蝡舀<EFBFBD><EFBFBD><EFBFBD>憪衤漱鈭鉝<EFBFBD>?*/
UFUNCTION(Server, Reliable) UFUNCTION(Server, Reliable)
void ServerRequestInteraction(int32 OptionIndex); void ServerRequestInteraction(int32 OptionIndex);
/** @brief 服务端执行即时交互。 */ /** @brief <EFBFBD>滚𦛚蝡舀<EFBFBD><EFBFBD><EFBFBD>嗡漱鈭鉝<EFBFBD>?*/
UFUNCTION(Server, Reliable) UFUNCTION(Server, Reliable)
void ServerRequestInstantInteraction(int32 OptionIndex); void ServerRequestInstantInteraction(int32 OptionIndex);
/** @brief 服务端结束交互。 */ /** @brief <EFBFBD>滚𦛚蝡舐<EFBFBD><EFBFBD>煺漱鈭鉝<EFBFBD>?*/
UFUNCTION(Server, Reliable) UFUNCTION(Server, Reliable)
void ServerEndInteraction(); void ServerEndInteraction();
/** @brief 服务端切换交互目标。 */ /** @brief <EFBFBD>滚𦛚蝡臬<EFBFBD><EFBFBD>漱鈭垍𤌍<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(Server, Reliable) UFUNCTION(Server, Reliable)
void ServerCycleInteractionTarget(bool bNext); void ServerCycleInteractionTarget(bool bNext);
/** @brief 角色共享状态组件。 */ /** @brief 閫坿𠧧<EFBFBD>曹澈<EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UPHYCharacterStateComponent> CharacterStateComponent; TObjectPtr<UPHYCharacterStateComponent> CharacterStateComponent;
/** @brief GCS 战斗系统组件。 */ /** @brief GCS <EFBFBD><EFBFBD>蝟餌<EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGCS_CombatSystemComponent> CombatSystemComponent; TObjectPtr<UGCS_CombatSystemComponent> CombatSystemComponent;
/** @brief GCS 目标系统组件。 */ /** @brief GCS <EFBFBD><EFBFBD>蝟餌<EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGCS_TargetingSystemComponent> TargetingSystemComponent; TObjectPtr<UGCS_TargetingSystemComponent> TargetingSystemComponent;
/** @brief GCS 战斗队伍代理组件。 */ /** @brief GCS <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGCS_CombatTeamAgentComponent> CombatTeamAgentComponent; TObjectPtr<UGCS_CombatTeamAgentComponent> CombatTeamAgentComponent;
/** @brief GGS 交互系统组件。 */ /** @brief GGS 鈭支<EFBFBD>蝟餌<EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGGS_InteractionSystemComponent> InteractionSystemComponent; TObjectPtr<UGGS_InteractionSystemComponent> InteractionSystemComponent;
/** @brief GGS 布娃娃组件。 */ /** @brief GGS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGGS_RagdollComponent> RagdollComponent; TObjectPtr<UGGS_RagdollComponent> RagdollComponent;
/** @brief GES 上下文效果组件。 */ /** @brief GES 銝𠹺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𦦵<EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGES_ContextEffectComponent> ContextEffectComponent; TObjectPtr<UGES_ContextEffectComponent> ContextEffectComponent;
/** @brief 运动源 Mesh 与显示层 Mesh 的桥接组件。 */ /** @brief 餈𣂼𢆡皞?Mesh 銝擧遬蝷箏<E89DB7> Mesh <20><><EFBFBD><EFBFBD>隞嗚<E99A9E>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation")
TObjectPtr<UPHYCharacterMeshBridgeComponent> MeshBridgeComponent; TObjectPtr<UPHYCharacterMeshBridgeComponent> MeshBridgeComponent;
/** @brief PHY 对 SLS 运动系统的桥接组件。 */ /** @brief SLS <20>雴辣<E99BB4><E8BEA3><EFBFBD><EFBFBD>亙藁蝏<E89781>辣嚗𣬚眏餈𣂼𢆡撅<F0A286A1><E69285>銝剜𦻖<E5899C><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion")
TObjectPtr<UPHYSLSMovementBridgeComponent> SLSMovementBridgeComponent;
/** @brief SLS 插件集成入口组件,由运动层集中接入。 */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion")
TObjectPtr<USLSIntegrationComponent> SLSIntegrationComponent; TObjectPtr<USLSIntegrationComponent> SLSIntegrationComponent;
/** @brief GenericGameSystem 可选集成入口组件。 */ /** @brief GenericGameSystem <EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣂼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion")
TObjectPtr<UActorComponent> GenericIntegrationComponent; TObjectPtr<UActorComponent> GenericIntegrationComponent;
/** @brief 显示层 Mesh 组件,承载职业和外观 Mesh*/ /** @brief <EFBFBD>曄內撅?Mesh 蝏<>辣嚗峕㗁頧質<E9A0A7>銝𡁜<E98A9D>憭𤥁<E686AD> Mesh<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation")
TObjectPtr<USkeletalMeshComponent> DisplayMeshComponent; TObjectPtr<USkeletalMeshComponent> DisplayMeshComponent;
/** @brief 当前 Avatar 缓存的 ASC玩家来自 PlayerStateAI 来自自身。 */ /** @brief 敶枏<EFBFBD> Avatar 蝻枏<EFBFBD><EFBFBD>?ASC嚗𣬚焵摰嗆䔉<E59786>?PlayerState嚗淾I <20>亥䌊<E4BAA5>芾澈<E88ABE>?*/
UPROPERTY(Transient) UPROPERTY(Transient)
TObjectPtr<UAbilitySystemComponent> CachedAbilitySystemComponent; TObjectPtr<UAbilitySystemComponent> CachedAbilitySystemComponent;
/** @brief ASC 是否已经初始化为当前 Avatar*/ /** @brief ASC <EFBFBD>臬炏撌脩<EFBFBD><EFBFBD><EFBFBD><EFBFBD>碶蛹敶枏<EFBFBD> Avatar<EFBFBD>?*/
UPROPERTY(Transient) UPROPERTY(Transient)
bool bAbilitySystemReady = false; bool bAbilitySystemReady = false;
}; };

View File

@@ -6,9 +6,10 @@
#include "Characters/PHYCharacterBase.h" #include "Characters/PHYCharacterBase.h"
#include "PHYPlayerCharacter.generated.h" #include "PHYPlayerCharacter.generated.h"
class USpringArmComponent;
class UCameraComponent; class UCameraComponent;
class UGIPS_InputSystemComponent; class UGIPS_InputSystemComponent;
class UPHYUGCSpringArmComponent;
/** /**
* @brief PHY 玩家角色。 * @brief PHY 玩家角色。
@@ -32,7 +33,7 @@ public:
/** @brief 获取 UGC 相机臂。 */ /** @brief 获取 UGC 相机臂。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Camera") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Camera")
UPHYUGCSpringArmComponent* GetCameraBoom() const { return CameraBoom; } USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
/** @brief 获取跟随相机。 */ /** @brief 获取跟随相机。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Camera") UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Camera")
@@ -52,7 +53,7 @@ protected:
/** @brief UGC 项目相机臂。 */ /** @brief UGC 项目相机臂。 */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Camera") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Camera")
TObjectPtr<UPHYUGCSpringArmComponent> CameraBoom; TObjectPtr<USpringArmComponent> CameraBoom;
/** @brief 玩家跟随相机。 */ /** @brief 玩家跟随相机。 */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Camera") UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Camera")

View File

@@ -1,53 +1,56 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Copyright Epic Games, Inc. All Rights Reserved.
#pragma once #pragma once
#include "NativeGameplayTags.h" #include "NativeGameplayTags.h"
/** /**
* @brief PHY 状态相关原生 Gameplay Tag * @brief PHY Gameplay Tag definitions.
*/ */
namespace PHYGameplayTags namespace PHYGameplayTags
{ {
/** @brief 角色处于战斗状态。 */ /** @brief Character combat state tags. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Combat); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Combat);
/** @brief 角色处于瞄准状态。 */ /** @brief Character aiming state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Aiming); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Aiming);
/** @brief 角色处于锁定目标状态。 */ /** @brief Character lock-on state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_LockedOn); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_LockedOn);
/** @brief 角色正在执行交互。 */ /** @brief In-combat action tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Interacting); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Interacting);
/** @brief UI 占用主要输入。 */ /** @brief UI open input state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_UI_Open); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_UI_Open);
/** @brief 角色已经进入死亡流程。 */ /** @brief Character dead state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Dead); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Dead);
/** @brief 角色处于行走移动状态。 */ /** @brief Movement walk state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Walk); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Walk);
/** @brief 角色处于常规跑动移动状态。 */ /** @brief Movement run state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Run); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Run);
/** @brief 角色处于冲刺移动状态。 */ /** @brief Movement sprint state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Sprint); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Sprint);
/** @brief 角色处于下落移动状态。 */ /** @brief Character falling movement state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Falling); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Falling);
/** @brief 角色使用默认移动集合。 */ /** @brief Default movement set tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_MovementSet_Default); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_MovementSet_Default);
/** @brief 角色使用瞄准移动集合。 */ /** @brief Aiming movement set tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_MovementSet_Aiming); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_MovementSet_Aiming);
/** @brief 角色旋转朝向移动方向。 */ /** @brief Movement rotation orient-to-movement mode tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_OrientToMovement); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_OrientToMovement);
/** @brief 角色旋转使用战斗横移模式。 */ /** @brief Looking-direction rotation mode tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_Strafe); UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_Looking);
/** @brief Aiming-direction rotation mode tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_Aiming);
} }

View File

@@ -1,97 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "PHYSLSMovementBridgeComponent.generated.h"
class ACharacter;
class USLSCharacterMovementComponent;
class USLSIntegrationComponent;
/**
* @brief PHY 对 Smooth Locomotion System 的首期运动桥接组件。
*
* 该组件缓存并初始化明确接入的 SLS 运动组件和 SLSIntegrationComponent
* 但不承担相机系统职责。
*/
UCLASS(BlueprintType, Blueprintable)
class PHY_API UPHYSLSMovementBridgeComponent : public UActorComponent
{
GENERATED_BODY()
public:
/** @brief 创建运动桥接组件。 */
UPHYSLSMovementBridgeComponent();
/**
* @brief 初始化 SLS 运动桥接。
* @param InCharacter 拥有该桥接组件的角色。
* @param InGenericIntegrationComponent 可选的 Generic 集成入口组件。
* @param InSLSIntegrationComponent SLS 插件集成入口组件。
* @return 初始化是否成功。
*/
UFUNCTION(BlueprintCallable, Category="PHY|Locomotion|SLS")
bool InitializeSLSMovementBridge(ACharacter* InCharacter, UActorComponent* InGenericIntegrationComponent, USLSIntegrationComponent* InSLSIntegrationComponent = nullptr);
/**
* @brief 通过 SLS 原生移动输入接口处理二维移动输入。
* @param MoveInput X 为右移输入Y 为前进输入。
* @return 成功路由到 SLS 运动组件时返回 true。
*/
UFUNCTION(BlueprintCallable, Category="PHY|Locomotion|SLS|Input")
bool HandleMoveInput(FVector2D MoveInput);
/**
* @brief 通过 SLS 原生视角输入接口处理二维视角输入。
* @param LookInput X 为 Yaw 输入Y 为 Pitch 输入。
* @return 成功路由到 SLS 运动组件时返回 true。
*/
UFUNCTION(BlueprintCallable, Category="PHY|Locomotion|SLS|Input")
bool HandleLookInput(FVector2D LookInput);
/** @brief 获取桥接到的角色。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Locomotion|SLS")
ACharacter* GetOwnerCharacter() const { return OwnerCharacter; }
/** @brief 获取 SLS 角色运动组件。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Locomotion|SLS")
USLSCharacterMovementComponent* GetSLSCharacterMovementComponent() const { return SLSCharacterMovementComponent; }
/** @brief 获取 SLS 插件集成入口组件。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Locomotion|SLS")
USLSIntegrationComponent* GetSLSIntegrationComponent() const { return SLSIntegrationComponent; }
/** @brief 获取可选的 Generic 集成入口组件。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Locomotion|SLS")
UActorComponent* GetGenericIntegrationComponent() const { return GenericIntegrationComponent; }
/** @brief 查询桥接是否已完成初始化。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Locomotion|SLS")
bool IsSLSMovementBridgeInitialized() const { return bInitialized; }
protected:
/** @brief 确保桥接组件已经缓存角色和 SLS 运动组件。 */
bool EnsureSLSMovementBridgeReady();
/** @brief 拥有 SLS 运动能力的角色。 */
UPROPERTY(Transient, BlueprintReadOnly, Category="PHY|Locomotion|SLS")
TObjectPtr<ACharacter> OwnerCharacter;
/** @brief SLS 核心角色运动组件。 */
UPROPERTY(Transient, BlueprintReadOnly, Category="PHY|Locomotion|SLS")
TObjectPtr<USLSCharacterMovementComponent> SLSCharacterMovementComponent;
/** @brief SLS 插件集成入口组件。 */
UPROPERTY(Transient, BlueprintReadOnly, Category="PHY|Locomotion|SLS")
TObjectPtr<USLSIntegrationComponent> SLSIntegrationComponent;
/** @brief GenericGameSystem 提供的可选集成入口。 */
UPROPERTY(Transient, BlueprintReadOnly, Category="PHY|Locomotion|SLS")
TObjectPtr<UActorComponent> GenericIntegrationComponent;
/** @brief 桥接初始化状态。 */
UPROPERTY(Transient, BlueprintReadOnly, Category="PHY|Locomotion|SLS")
bool bInitialized = false;
};