修复bug

This commit is contained in:
2026-04-26 18:49:19 +08:00
parent 88d01f588b
commit 6ca0f21163
19 changed files with 179 additions and 145 deletions

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

@@ -27,6 +27,24 @@
#include "Targeting/GCS_TargetingSystemComponent.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)
: Super(ObjectInitializer.SetDefaultSubobjectClass<USLSCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))
{
@@ -136,6 +154,11 @@ void APHYCharacterBase::BeginPlay()
}
}
if (CharacterStateComponent)
{
SetRotationMode_Implementation(CharacterStateComponent->GetRotationMode());
}
UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(this, UGameFrameworkComponentManager::NAME_GameActorReady);
}
@@ -268,15 +291,10 @@ bool APHYCharacterBase::HandleInputTag(const FGameplayTag InputTag, const ETrigg
if (InputTag == PHYGameplayTags::Input_Aim)
{
if (USLSCharacterMovementComponent* SLSMovementComponent = GetSLSCharacterMovementComponent())
{
SLSMovementComponent->UpdateRotationMode(bPressed ? ESLSRotationMode::AimingDirection : ESLSRotationMode::VelocityDirection);
}
SetRotationMode_Implementation(bPressed ? PHYGameplayTags::State_Rotation_Aiming : PHYGameplayTags::State_Rotation_OrientToMovement);
if (CharacterStateComponent)
{
CharacterStateComponent->SetMovementSet(bPressed ? PHYGameplayTags::State_MovementSet_Aiming : PHYGameplayTags::State_MovementSet_Default);
CharacterStateComponent->SetRotationMode(bPressed ? PHYGameplayTags::State_Rotation_Strafe : PHYGameplayTags::State_Rotation_OrientToMovement);
}
return true;
@@ -489,6 +507,11 @@ void APHYCharacterBase::SetRotationMode_Implementation(const FGameplayTag NewRot
{
CharacterStateComponent->SetRotationMode(NewRotationMode);
}
if (USLSCharacterMovementComponent* SLSMovementComponent = GetSLSCharacterMovementComponent())
{
SLSMovementComponent->UpdateRotationMode(GetSLSRotationMode(NewRotationMode));
}
}
FGameplayTag APHYCharacterBase::GetRotationMode_Implementation() const

View File

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

@@ -24,264 +24,261 @@ class USLSCharacterMovementComponent;
class USLSIntegrationComponent;
/**
* @brief PHY 玩家和 AI 共用角色基类。
*
* 基类直接继承 ACharacter并通过项目级组件和接口适配 GAS、GCS、GGS、UGC 与后续运动系统。
*/
* @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>? */
UCLASS(Abstract, BlueprintType, Blueprintable)
class PHY_API APHYCharacterBase : public ACharacter, public IAbilitySystemInterface, public IGameplayTagAssetInterface, public IGCS_CombatEntityInterface
{
GENERATED_BODY()
public:
/** @brief 构造基础角色组件。 */
/** @brief <EFBFBD><EFBFBD><EFBFBD>惩抅蝖<EFBFBD>閫坿𠧧蝏<EFBFBD><EFBFBD>?*/
APHYCharacterBase(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
/** @brief 注册 ModularGameplay 组件接收者。 */
/** @brief 瘜典<EFBFBD> ModularGameplay <EFBFBD><EFBFBD>交𤣰<EFBFBD><EFBFBD><EFBFBD>?*/
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;
/** @brief 初始化角色运行时组件。 */
/** @brief <EFBFBD><EFBFBD><EFBFBD>𤥁<EFBFBD><EFBFBD><EFBFBD>銵峕𧒄蝏<EFBFBD><EFBFBD>?*/
virtual void BeginPlay() override;
/** @brief 移除 ModularGameplay 组件接收者。 */
/** @brief 蝘駁膄 ModularGameplay <EFBFBD><EFBFBD>交𤣰<EFBFBD><EFBFBD><EFBFBD>?*/
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
/** @brief 控制器接管时刷新项目状态。 */
/** @brief <EFBFBD><EFBFBD><EFBFBD>冽𦻖蝞⊥𧒄<EFBFBD>瑟鰵憿寧𤌍<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
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;
/** @brief 获取当前角色使用的 AbilitySystemComponent*/
/** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD>閫坿𠧧雿輻鍂<EFBFBD>?AbilitySystemComponent<EFBFBD>?*/
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;
/** @brief 初始化当前 Avatar 对应的 ASC*/
/** @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?Avatar 撖孵<EFBFBD><EFBFBD>?ASC<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability")
virtual void InitializeAbilitySystem(UAbilitySystemComponent* NewAbilitySystemComponent, AActor* OwnerActor);
/** @brief 清理角色缓存的 ASC 引用。 */
/** @brief <EFBFBD><EFBFBD>閫坿𠧧蝻枏<EFBFBD><EFBFBD>?ASC 撘閧鍂<E996A7>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability")
virtual void ClearAbilitySystem();
/** @brief 查询 ASC 是否已经完成项目级初始化。 */
/** @brief <EFBFBD>亥砭 ASC <EFBFBD>臬炏撌脩<EFBFBD>摰峕<EFBFBD>憿寧𤌍蝥批<EFBFBD>憪见<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Ability")
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")
virtual bool HandleInputTag(FGameplayTag InputTag, ETriggerEvent TriggerEvent);
/** @brief 设置移动意图,并在客户端请求服务端同步。 */
/** @brief 霈曄蔭蝘餃𢆡<EFBFBD>誩㦛嚗<EFBFBD><EFBFBD>典恥<EFBFBD>瑞垢霂瑟<EFBFBD><EFBFBD>滚𦛚蝡臬<EFBFBD>甇乓<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Movement")
virtual void SetMovementIntent(FVector NewMovementIntent);
/** @brief 设置项目级战斗目标。 */
/** @brief 霈曄蔭憿寧𤌍蝥扳<EFBFBD><EFBFBD>㛖𤌍<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Combat")
virtual void SetCombatTargetActor(AActor* NewCombatTargetActor);
/** @brief 请求开始交互。 */
/** @brief 霂瑟<EFBFBD><EFBFBD>憪衤漱鈭鉝<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual bool RequestInteraction(int32 OptionIndex = 0);
/** @brief 请求一次性即时交互。 */
/** @brief 霂瑟<EFBFBD><EFBFBD>甈⊥<EFBFBD>批朖<EFBFBD>嗡漱鈭鉝<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual bool RequestInstantInteraction(int32 OptionIndex = 0);
/** @brief 请求结束当前交互。 */
/** @brief 霂瑟<EFBFBD>蝏𤘪<EFBFBD>敶枏<EFBFBD>鈭支<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual void EndInteraction();
/** @brief 请求切换当前可交互对象。 */
/** @brief 霂瑟<EFBFBD><EFBFBD><EFBFBD>揢敶枏<EFBFBD><EFBFBD>臭漱鈭鍦笆鞊<EFBFBD>?*/
UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction")
virtual void CycleInteractionTarget(bool bNext);
/** @brief 获取项目角色状态组件。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UPHYCharacterStateComponent* GetCharacterStateComponent() const { return CharacterStateComponent; }
/** @brief 获取 GCS 战斗组件。 */
/** @brief <EFBFBD><EFBFBD> GCS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGCS_CombatSystemComponent* GetCombatSystemComponent() const { return CombatSystemComponent; }
/** @brief 获取 GCS 目标组件。 */
/** @brief <EFBFBD><EFBFBD> GCS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGCS_TargetingSystemComponent* GetTargetingSystemComponent() const { return TargetingSystemComponent; }
/** @brief 获取 GGS 交互组件。 */
/** @brief <EFBFBD><EFBFBD> GGS 鈭支<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGGS_InteractionSystemComponent* GetInteractionSystemComponent() const { return InteractionSystemComponent; }
/** @brief 获取 GGS 布娃娃组件。 */
/** @brief <EFBFBD><EFBFBD> GGS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGGS_RagdollComponent* GetRagdollComponent() const { return RagdollComponent; }
/** @brief 获取上下文效果组件。 */
/** @brief <EFBFBD><EFBFBD>銝𠹺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𦦵<EFBFBD>隞嗚<EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character")
UGES_ContextEffectComponent* GetContextEffectComponent() const { return ContextEffectComponent; }
/** @brief 获取角色 Mesh Bridge 组件。 */
/** @brief <EFBFBD><EFBFBD>閫坿𠧧 Mesh Bridge <EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation")
UPHYCharacterMeshBridgeComponent* GetMeshBridgeComponent() const { return MeshBridgeComponent; }
/** @brief 获取 SLS 角色运动组件。 */
/** @brief <EFBFBD><EFBFBD> SLS 閫坿𠧧餈𣂼𢆡蝏<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion")
USLSCharacterMovementComponent* GetSLSCharacterMovementComponent() const;
/** @brief 获取 SLS 集成入口组件。 */
/** @brief <EFBFBD><EFBFBD> SLS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>亙藁蝏<EFBFBD><EFBFBD>?*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion")
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")
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")
USkeletalMeshComponent* GetDisplayMeshComponent() const { return DisplayMeshComponent; }
/** @brief 获取当前战斗目标 Actor*/
/** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Actor<EFBFBD>?*/
virtual AActor* GetCombatTargetActor_Implementation() const override;
/** @brief 获取连击定义表,首期骨架默认不绑定表。 */
/** @brief <EFBFBD><EFBFBD>餈𧼮稬摰帋<EFBFBD>銵剁<EFBFBD>擐𡝗<EFBFBD>撉冽沲暺䁅恕銝滨<EFBFBD>摰朞”<EFBFBD>?*/
virtual const UDataTable* GetComboDefinitionTable_Implementation() const override;
/** @brief 获取当前战斗目标场景对象。 */
/** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>箸艶撖寡情<EFBFBD>?*/
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;
/** @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;
/** @brief Tag 查询当前武器。 */
/** @brief <EFBFBD>?Tag <EFBFBD>亥砭敶枏<EFBFBD>甇血膥<EFBFBD>?*/
virtual UObject* QueryWeapon_Implementation(const FGameplayTagQuery& Query) const override;
/** @brief 设置旋转模式。 */
/** @brief 霈曄蔭<EFBFBD>贝蓮璅<EFBFBD><EFBFBD>?*/
virtual void SetRotationMode_Implementation(FGameplayTag NewRotationMode) override;
/** @brief 获取旋转模式。 */
/** @brief <EFBFBD><EFBFBD><EFBFBD>贝蓮璅<EFBFBD><EFBFBD>?*/
virtual FGameplayTag GetRotationMode_Implementation() const override;
/** @brief 设置移动集合。 */
/** @brief 霈曄蔭蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual void SetMovementSet_Implementation(FGameplayTag NewMovementSet) override;
/** @brief 获取移动集合。 */
/** @brief <EFBFBD><EFBFBD>蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual FGameplayTag GetMovementSet_Implementation() const override;
/** @brief 设置移动状态。 */
/** @brief 霈曄蔭蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual void SetMovementState_Implementation(FGameplayTag NewMovementState) override;
/** @brief 获取移动状态。 */
/** @brief <EFBFBD><EFBFBD>蝘餃𢆡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
virtual FGameplayTag GetMovementState_Implementation() const override;
/** @brief 开始死亡流程。 */
/** @brief <EFBFBD>憪𧢲香鈭⊥<EFBFBD>蝔卝<EFBFBD>?*/
virtual void StartDeath_Implementation() override;
/** @brief 完成死亡流程。 */
/** @brief 摰峕<EFBFBD>甇颱滿瘚<EFBFBD><EFBFBD><EFBFBD>?*/
virtual void FinishDeath_Implementation() override;
/** @brief 查询角色是否死亡。 */
/** @brief <EFBFBD>亥砭閫坿𠧧<EFBFBD>臬炏甇颱滿<EFBFBD>?*/
virtual bool IsDead_Implementation() const override;
/** @brief 获取移动意图。 */
/** @brief <EFBFBD><EFBFBD>蝘餃𢆡<EFBFBD>誩㦛<EFBFBD>?*/
virtual FVector GetMovementIntent_Implementation() const override;
/** @brief 获取当前武器。 */
/** @brief <EFBFBD><EFBFBD>敶枏<EFBFBD>甇血膥<EFBFBD>?*/
virtual UObject* GetCurrentWeapon_Implementation(UObject* Context = nullptr) const override;
/** @brief 设置当前武器。 */
/** @brief 霈曄蔭敶枏<EFBFBD>甇血膥<EFBFBD>?*/
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;
protected:
/** @brief 将输入 Tag 映射为 Ability Tag*/
/** @brief <EFBFBD><EFBFBD><EFBFBD>?Tag <20><EFBFBD>銝?Ability Tag<EFBFBD>?*/
virtual FGameplayTag GetAbilityTagForInputTag(FGameplayTag InputTag) const;
/** @brief 应用 Character 配置默认值。 */
/** @brief 摨𠉛鍂 Character <EFBFBD>滨蔭暺䁅恕<EFBFBD><EFBFBD>?*/
virtual void ApplyCharacterSettings();
/** @brief 服务端同步移动意图。 */
/** @brief <EFBFBD>滚𦛚蝡臬<EFBFBD>甇亦宏<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(Server, Unreliable)
void ServerSetMovementIntent(FVector NewMovementIntent);
/** @brief 服务端设置战斗目标。 */
/** @brief <EFBFBD>滚𦛚蝡航挽蝵格<EFBFBD><EFBFBD>㛖𤌍<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(Server, Reliable)
void ServerSetCombatTargetActor(AActor* NewCombatTargetActor);
/** @brief 服务端执行开始交互。 */
/** @brief <EFBFBD>滚𦛚蝡舀<EFBFBD><EFBFBD><EFBFBD>憪衤漱鈭鉝<EFBFBD>?*/
UFUNCTION(Server, Reliable)
void ServerRequestInteraction(int32 OptionIndex);
/** @brief 服务端执行即时交互。 */
/** @brief <EFBFBD>滚𦛚蝡舀<EFBFBD><EFBFBD><EFBFBD>嗡漱鈭鉝<EFBFBD>?*/
UFUNCTION(Server, Reliable)
void ServerRequestInstantInteraction(int32 OptionIndex);
/** @brief 服务端结束交互。 */
/** @brief <EFBFBD>滚𦛚蝡舐<EFBFBD><EFBFBD>煺漱鈭鉝<EFBFBD>?*/
UFUNCTION(Server, Reliable)
void ServerEndInteraction();
/** @brief 服务端切换交互目标。 */
/** @brief <EFBFBD>滚𦛚蝡臬<EFBFBD><EFBFBD>漱鈭垍𤌍<EFBFBD><EFBFBD><EFBFBD>?*/
UFUNCTION(Server, Reliable)
void ServerCycleInteractionTarget(bool bNext);
/** @brief 角色共享状态组件。 */
/** @brief 閫坿𠧧<EFBFBD>曹澈<EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UPHYCharacterStateComponent> CharacterStateComponent;
/** @brief GCS 战斗系统组件。 */
/** @brief GCS <EFBFBD><EFBFBD>蝟餌<EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGCS_CombatSystemComponent> CombatSystemComponent;
/** @brief GCS 目标系统组件。 */
/** @brief GCS <EFBFBD><EFBFBD>蝟餌<EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGCS_TargetingSystemComponent> TargetingSystemComponent;
/** @brief GCS 战斗队伍代理组件。 */
/** @brief GCS <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGCS_CombatTeamAgentComponent> CombatTeamAgentComponent;
/** @brief GGS 交互系统组件。 */
/** @brief GGS 鈭支<EFBFBD>蝟餌<EFBFBD><EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGGS_InteractionSystemComponent> InteractionSystemComponent;
/** @brief GGS 布娃娃组件。 */
/** @brief GGS <EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGGS_RagdollComponent> RagdollComponent;
/** @brief GES 上下文效果组件。 */
/** @brief GES 銝𠹺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𦦵<EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character")
TObjectPtr<UGES_ContextEffectComponent> ContextEffectComponent;
/** @brief 运动源 Mesh 与显示层 Mesh 的桥接组件。 */
/** @brief 餈𣂼𢆡皞?Mesh 銝擧遬蝷箏<E89DB7> Mesh <20><><EFBFBD><EFBFBD>隞嗚<E99A9E>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation")
TObjectPtr<UPHYCharacterMeshBridgeComponent> MeshBridgeComponent;
/** @brief SLS 插件集成入口组件,由运动层集中接入。 */
/** @brief SLS <EFBFBD>雴辣<EFBFBD><EFBFBD><EFBFBD><EFBFBD>亙藁蝏<EFBFBD>辣嚗𣬚眏餈𣂼𢆡撅<EFBFBD><EFBFBD>銝剜𦻖<EFBFBD><EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion")
TObjectPtr<USLSIntegrationComponent> SLSIntegrationComponent;
/** @brief GenericGameSystem 可选集成入口组件。 */
/** @brief GenericGameSystem <EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣂼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>隞嗚<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion")
TObjectPtr<UActorComponent> GenericIntegrationComponent;
/** @brief 显示层 Mesh 组件,承载职业和外观 Mesh*/
/** @brief <EFBFBD>曄內撅?Mesh 蝏<>辣嚗峕㗁頧質<E9A0A7>銝𡁜<E98A9D>憭𤥁<E686AD> Mesh<EFBFBD>?*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation")
TObjectPtr<USkeletalMeshComponent> DisplayMeshComponent;
/** @brief 当前 Avatar 缓存的 ASC玩家来自 PlayerStateAI 来自自身。 */
/** @brief 敶枏<EFBFBD> Avatar 蝻枏<EFBFBD><EFBFBD>?ASC嚗𣬚焵摰嗆䔉<E59786>?PlayerState嚗淾I <20>亥䌊<E4BAA5>芾澈<E88ABE>?*/
UPROPERTY(Transient)
TObjectPtr<UAbilitySystemComponent> CachedAbilitySystemComponent;
/** @brief ASC 是否已经初始化为当前 Avatar*/
/** @brief ASC <EFBFBD>臬炏撌脩<EFBFBD><EFBFBD><EFBFBD><EFBFBD>碶蛹敶枏<EFBFBD> Avatar<EFBFBD>?*/
UPROPERTY(Transient)
bool bAbilitySystemReady = false;
};

View File

@@ -6,9 +6,10 @@
#include "Characters/PHYCharacterBase.h"
#include "PHYPlayerCharacter.generated.h"
class USpringArmComponent;
class UCameraComponent;
class UGIPS_InputSystemComponent;
class UPHYUGCSpringArmComponent;
/**
* @brief PHY 玩家角色。
@@ -32,7 +33,7 @@ public:
/** @brief 获取 UGC 相机臂。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Camera")
UPHYUGCSpringArmComponent* GetCameraBoom() const { return CameraBoom; }
USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
/** @brief 获取跟随相机。 */
UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Camera")
@@ -52,7 +53,7 @@ protected:
/** @brief UGC 项目相机臂。 */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Camera")
TObjectPtr<UPHYUGCSpringArmComponent> CameraBoom;
TObjectPtr<USpringArmComponent> CameraBoom;
/** @brief 玩家跟随相机。 */
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
#include "NativeGameplayTags.h"
/**
* @brief PHY 状态相关原生 Gameplay Tag
* @brief PHY Gameplay Tag definitions.
*/
namespace PHYGameplayTags
{
/** @brief 角色处于战斗状态。 */
/** @brief Character combat state tags. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Combat);
/** @brief 角色处于瞄准状态。 */
/** @brief Character aiming state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Aiming);
/** @brief 角色处于锁定目标状态。 */
/** @brief Character lock-on state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_LockedOn);
/** @brief 角色正在执行交互。 */
/** @brief In-combat action tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Interacting);
/** @brief UI 占用主要输入。 */
/** @brief UI open input state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_UI_Open);
/** @brief 角色已经进入死亡流程。 */
/** @brief Character dead state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Dead);
/** @brief 角色处于行走移动状态。 */
/** @brief Movement walk state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Walk);
/** @brief 角色处于常规跑动移动状态。 */
/** @brief Movement run state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Run);
/** @brief 角色处于冲刺移动状态。 */
/** @brief Movement sprint state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Sprint);
/** @brief 角色处于下落移动状态。 */
/** @brief Character falling movement state tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Movement_Falling);
/** @brief 角色使用默认移动集合。 */
/** @brief Default movement set tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_MovementSet_Default);
/** @brief 角色使用瞄准移动集合。 */
/** @brief Aiming movement set tag. */
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);
/** @brief 角色旋转使用战斗横移模式。 */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_Strafe);
/** @brief Looking-direction rotation mode tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_Looking);
/** @brief Aiming-direction rotation mode tag. */
UE_DECLARE_GAMEPLAY_TAG_EXTERN(State_Rotation_Aiming);
}