From 6ca0f21163b9d5719d241ac6d044ef3262f59abc Mon Sep 17 00:00:00 2001 From: cit110 <840418418@qq.com> Date: Sun, 26 Apr 2026 18:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/DefaultEngine.ini | 12 ++ Config/DefaultPHYAnimation.ini | 4 +- .../Animation/DA_Ida_IntegrationData.uasset | 3 + .../Retargeters/ABP_Retargeter.uasset | 4 +- .../Character/Player/BP_PlayerBase.uasset | 4 +- .../Camera/BP_CameraManager_Default.uasset | 4 +- .../Gameplay/Player/BP_PHYPlayerState.uasset | 4 +- Content/AGame/Input/IC_Default.uasset | 4 +- Content/AGame/Input/IMC_Default.uasset | 4 +- Content/AGame/Map/Map_Test.umap | 4 +- PHY.uproject | 22 ++- .../Camera/PHYUGCSpringArmComponent.cpp | 7 - .../Private/Characters/PHYCharacterBase.cpp | 35 ++++- .../Private/Characters/PHYPlayerCharacter.cpp | 3 +- .../GameplayTags/PHYGameplayTags_State.cpp | 3 +- .../Public/Camera/PHYUGCSpringArmComponent.h | 18 --- .../PHY/Public/Characters/PHYCharacterBase.h | 145 +++++++++--------- .../Public/Characters/PHYPlayerCharacter.h | 7 +- .../GameplayTags/PHYGameplayTags_State.h | 37 +++-- 19 files changed, 179 insertions(+), 145 deletions(-) create mode 100644 Content/AGame/Animation/DA_Ida_IntegrationData.uasset delete mode 100644 Source/PHY/Private/Camera/PHYUGCSpringArmComponent.cpp delete mode 100644 Source/PHY/Public/Camera/PHYUGCSpringArmComponent.h diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 6f2b361..54cb162 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -159,3 +159,15 @@ ManualIPAddress= +CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle") +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 + diff --git a/Config/DefaultPHYAnimation.ini b/Config/DefaultPHYAnimation.ini index 0fd5cdc..f71d0c3 100644 --- a/Config/DefaultPHYAnimation.ini +++ b/Config/DefaultPHYAnimation.ini @@ -1,9 +1,9 @@ [/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" DefaultDisplayAnimClass="/Game/AGame/Animation/Retargeters/ABP_Retargeter.ABP_Retargeter_C" DefaultIKRetargeter="/Game/AGame/Animation/Retargeters/RTG_Manny_To_Ida.RTG_Manny_To_Ida" -bHideSourceMeshInGame=True +bHideSourceMeshInGame=False bPreferLeaderPoseForSameSkeleton=True bAllowRuntimeVisualMeshSwitch=True bApplyPlayerClassMeshToAI=False diff --git a/Content/AGame/Animation/DA_Ida_IntegrationData.uasset b/Content/AGame/Animation/DA_Ida_IntegrationData.uasset new file mode 100644 index 0000000..2adc7af --- /dev/null +++ b/Content/AGame/Animation/DA_Ida_IntegrationData.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b936d334eb8776951db8e5afacb606fd09107bc4d7b42862b454ba611cdd903 +size 72691 diff --git a/Content/AGame/Animation/Retargeters/ABP_Retargeter.uasset b/Content/AGame/Animation/Retargeters/ABP_Retargeter.uasset index dbcb2ed..bbcfd0c 100644 --- a/Content/AGame/Animation/Retargeters/ABP_Retargeter.uasset +++ b/Content/AGame/Animation/Retargeters/ABP_Retargeter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:433940385a1a810da8a29bfd4f3f6bc811d29b6684444e40da9b4e317ad6399c -size 51382 +oid sha256:b9c9f5a84b1f2b2aba0446e05f7619f7fc7855b0a03d855825edeb72cb0b927a +size 49489 diff --git a/Content/AGame/Character/Player/BP_PlayerBase.uasset b/Content/AGame/Character/Player/BP_PlayerBase.uasset index fe231d9..7d71416 100644 --- a/Content/AGame/Character/Player/BP_PlayerBase.uasset +++ b/Content/AGame/Character/Player/BP_PlayerBase.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:06c8d3c10519caf4d268e9ffa94ddde48883aa4862fdde4d0e879b2fd9acb4a1 -size 35561 +oid sha256:053e021518ec097acca8034099fe9a50a92fe93854ce9a4d0ed258b3f4c21cea +size 59429 diff --git a/Content/AGame/Gameplay/Camera/BP_CameraManager_Default.uasset b/Content/AGame/Gameplay/Camera/BP_CameraManager_Default.uasset index a4bb05f..29d1793 100644 --- a/Content/AGame/Gameplay/Camera/BP_CameraManager_Default.uasset +++ b/Content/AGame/Gameplay/Camera/BP_CameraManager_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e677a36524dc5950c583dd0a708a3ae44e12cfbd4fb279ca6ef79216dbd39c54 -size 29631 +oid sha256:c6db1f69dff59ff8df9f1a186212339356e14f894e1601b2d3702e6342f1f6b0 +size 36956 diff --git a/Content/AGame/Gameplay/Player/BP_PHYPlayerState.uasset b/Content/AGame/Gameplay/Player/BP_PHYPlayerState.uasset index 984e706..4c38c05 100644 --- a/Content/AGame/Gameplay/Player/BP_PHYPlayerState.uasset +++ b/Content/AGame/Gameplay/Player/BP_PHYPlayerState.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f26c2488de5afa655479e7670260b2cc9d928e3ecc9256109611ea2abbd58e22 -size 22578 +oid sha256:806c28d25fab272ef8a299ffff22ac8b7c0cbd1cae9debb8b16bf2453b8e3033 +size 22699 diff --git a/Content/AGame/Input/IC_Default.uasset b/Content/AGame/Input/IC_Default.uasset index a0602ba..fea4939 100644 --- a/Content/AGame/Input/IC_Default.uasset +++ b/Content/AGame/Input/IC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:44b0f350f21ee90c6b04c8ecf302959d59aa10320daa9dac17a01d7cd0baef27 -size 2103 +oid sha256:5db30a03a9cdd2d51080637f025e3456a4227b075d5ca7724f4e46a11f82eb0e +size 2257 diff --git a/Content/AGame/Input/IMC_Default.uasset b/Content/AGame/Input/IMC_Default.uasset index fcac743..2fb81a3 100644 --- a/Content/AGame/Input/IMC_Default.uasset +++ b/Content/AGame/Input/IMC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ea3694b44f36222541d6cdf14b85969c04717d6ab219a26f1dce9c8a9627c8c -size 4582 +oid sha256:bca671a33ee358157f169fdbdc87a41bbfaff0846f00cba9bfe5d7bc5b670547 +size 4765 diff --git a/Content/AGame/Map/Map_Test.umap b/Content/AGame/Map/Map_Test.umap index fde6266..64237a9 100644 --- a/Content/AGame/Map/Map_Test.umap +++ b/Content/AGame/Map/Map_Test.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6bcf2c28a220e561c57bf16f5dd9a3165eaff3bfba5057f65219742cd1ca5129 -size 48664 +oid sha256:a3999b93d9700bdfa4a708983125c4d143f63502781255af161b203b35ea8d8c +size 48908 diff --git a/PHY.uproject b/PHY.uproject index 18c3676..2865156 100644 --- a/PHY.uproject +++ b/PHY.uproject @@ -11,6 +11,10 @@ } ], "Plugins": [ + { + "Name": "PythonScriptPlugin", + "Enabled": true + }, { "Name": "ModelingToolsEditorMode", "Enabled": true, @@ -57,6 +61,22 @@ "SupportedTargetPlatforms": [ "Win64" ] + }, + { + "Name": "UE_MCP_Bridge", + "Enabled": true + }, + { + "Name": "Niagara", + "Enabled": true + }, + { + "Name": "PCG", + "Enabled": true + }, + { + "Name": "EnhancedInput", + "Enabled": true } ] -} +} \ No newline at end of file diff --git a/Source/PHY/Private/Camera/PHYUGCSpringArmComponent.cpp b/Source/PHY/Private/Camera/PHYUGCSpringArmComponent.cpp deleted file mode 100644 index dda7db2..0000000 --- a/Source/PHY/Private/Camera/PHYUGCSpringArmComponent.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "Camera/PHYUGCSpringArmComponent.h" - -#include UE_INLINE_GENERATED_CPP_BY_NAME(PHYUGCSpringArmComponent) - -// 当前包装层只解除抽象限制,后续相机专家可在这里集中扩展 UGC 项目逻辑。 diff --git a/Source/PHY/Private/Characters/PHYCharacterBase.cpp b/Source/PHY/Private/Characters/PHYCharacterBase.cpp index d4ecd90..1ce0009 100644 --- a/Source/PHY/Private/Characters/PHYCharacterBase.cpp +++ b/Source/PHY/Private/Characters/PHYCharacterBase.cpp @@ -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(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 diff --git a/Source/PHY/Private/Characters/PHYPlayerCharacter.cpp b/Source/PHY/Private/Characters/PHYPlayerCharacter.cpp index 9c477b3..8e3d28e 100644 --- a/Source/PHY/Private/Characters/PHYPlayerCharacter.cpp +++ b/Source/PHY/Private/Characters/PHYPlayerCharacter.cpp @@ -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(TEXT("InputSystemComponent")); - CameraBoom = CreateDefaultSubobject(TEXT("CameraBoom")); + CameraBoom = CreateDefaultSubobject(TEXT("CameraBoom")); CameraBoom->SetupAttachment(GetRootComponent()); CameraBoom->TargetArmLength = 320.0f; CameraBoom->bUsePawnControlRotation = true; diff --git a/Source/PHY/Private/GameplayTags/PHYGameplayTags_State.cpp b/Source/PHY/Private/GameplayTags/PHYGameplayTags_State.cpp index 045f843..6c2d922 100644 --- a/Source/PHY/Private/GameplayTags/PHYGameplayTags_State.cpp +++ b/Source/PHY/Private/GameplayTags/PHYGameplayTags_State.cpp @@ -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"); } diff --git a/Source/PHY/Public/Camera/PHYUGCSpringArmComponent.h b/Source/PHY/Public/Camera/PHYUGCSpringArmComponent.h deleted file mode 100644 index d6cd990..0000000 --- a/Source/PHY/Public/Camera/PHYUGCSpringArmComponent.h +++ /dev/null @@ -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() -}; diff --git a/Source/PHY/Public/Characters/PHYCharacterBase.h b/Source/PHY/Public/Characters/PHYCharacterBase.h index 282d9f3..e583ecc 100644 --- a/Source/PHY/Public/Characters/PHYCharacterBase.h +++ b/Source/PHY/Public/Characters/PHYCharacterBase.h @@ -24,264 +24,261 @@ class USLSCharacterMovementComponent; class USLSIntegrationComponent; /** - * @brief PHY 玩家和 AI 共用角色基类。 - * - * 基类直接继承 ACharacter,并通过项目级组件和接口适配 GAS、GCS、GGS、UGC 与后续运动系统。 - */ + * @brief PHY 玩家?AI 共用角色基类? * + * 基类直接继承 ACharacter,并通过项目级组件和接口适配 GAS、GCS、GGS、UGC 与后续运动系统? */ UCLASS(Abstract, BlueprintType, Blueprintable) class PHY_API APHYCharacterBase : public ACharacter, public IAbilitySystemInterface, public IGameplayTagAssetInterface, public IGCS_CombatEntityInterface { GENERATED_BODY() public: - /** @brief 构造基础角色组件。 */ + /** @brief 构造基础角色组件?*/ APHYCharacterBase(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); - /** @brief 注册 ModularGameplay 组件接收者。 */ + /** @brief 注册 ModularGameplay 组件接收者?*/ virtual void PreInitializeComponents() override; - /** @brief 在 Possess 和 PlayerState 初始化前绑定显示层 Mesh 桥接组件。 */ + /** @brief ?Possess ?PlayerState 初始化前绑定显示?Mesh 桥接组件?*/ virtual void PostInitializeComponents() override; - /** @brief 初始化角色运行时组件。 */ + /** @brief 初始化角色运行时组件?*/ virtual void BeginPlay() override; - /** @brief 移除 ModularGameplay 组件接收者。 */ + /** @brief 移除 ModularGameplay 组件接收者?*/ virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; - /** @brief 控制器接管时刷新项目状态。 */ + /** @brief 控制器接管时刷新项目状态?*/ virtual void PossessedBy(AController* NewController) override; - /** @brief 控制器复制到客户端后刷新项目状态。 */ + /** @brief 控制器复制到客户端后刷新项目状态?*/ virtual void OnRep_Controller() override; - /** @brief 获取当前角色使用的 AbilitySystemComponent。 */ + /** @brief 获取当前角色使用?AbilitySystemComponent?*/ virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; - /** @brief 收集 ASC 与角色状态组件提供的 GameplayTag。 */ + /** @brief 收集 ASC 与角色状态组件提供的 GameplayTag?*/ virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override; - /** @brief 初始化当前 Avatar 对应的 ASC。 */ + /** @brief 初始化当?Avatar 对应?ASC?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability") virtual void InitializeAbilitySystem(UAbilitySystemComponent* NewAbilitySystemComponent, AActor* OwnerActor); - /** @brief 清理角色缓存的 ASC 引用。 */ + /** @brief 清理角色缓存?ASC 引用?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Ability") virtual void ClearAbilitySystem(); - /** @brief 查询 ASC 是否已经完成项目级初始化。 */ + /** @brief 查询 ASC 是否已经完成项目级初始化?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Ability") bool IsAbilitySystemReady() const { return bAbilitySystemReady; } - /** @brief 接收输入 Tag 并路由到移动、交互或 GAS Ability。 */ + /** @brief 接收输入 Tag 并路由到移动、交互或 GAS Ability?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Input") virtual bool HandleInputTag(FGameplayTag InputTag, ETriggerEvent TriggerEvent); - /** @brief 设置移动意图,并在客户端请求服务端同步。 */ + /** @brief 设置移动意图,并在客户端请求服务端同步?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Movement") virtual void SetMovementIntent(FVector NewMovementIntent); - /** @brief 设置项目级战斗目标。 */ + /** @brief 设置项目级战斗目标?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Combat") virtual void SetCombatTargetActor(AActor* NewCombatTargetActor); - /** @brief 请求开始交互。 */ + /** @brief 请求开始交互?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") virtual bool RequestInteraction(int32 OptionIndex = 0); - /** @brief 请求一次性即时交互。 */ + /** @brief 请求一次性即时交互?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") virtual bool RequestInstantInteraction(int32 OptionIndex = 0); - /** @brief 请求结束当前交互。 */ + /** @brief 请求结束当前交互?*/ UFUNCTION(BlueprintCallable, Category="PHY|Character|Interaction") virtual void EndInteraction(); - /** @brief 请求切换当前可交互对象。 */ + /** @brief 请求切换当前可交互对象?*/ 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 获取 GCS 战斗组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UGCS_CombatSystemComponent* GetCombatSystemComponent() const { return CombatSystemComponent; } - /** @brief 获取 GCS 目标组件。 */ + /** @brief 获取 GCS 目标组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UGCS_TargetingSystemComponent* GetTargetingSystemComponent() const { return TargetingSystemComponent; } - /** @brief 获取 GGS 交互组件。 */ + /** @brief 获取 GGS 交互组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UGGS_InteractionSystemComponent* GetInteractionSystemComponent() const { return InteractionSystemComponent; } - /** @brief 获取 GGS 布娃娃组件。 */ + /** @brief 获取 GGS 布娃娃组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UGGS_RagdollComponent* GetRagdollComponent() const { return RagdollComponent; } - /** @brief 获取上下文效果组件。 */ + /** @brief 获取上下文效果组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character") UGES_ContextEffectComponent* GetContextEffectComponent() const { return ContextEffectComponent; } - /** @brief 获取角色 Mesh Bridge 组件。 */ + /** @brief 获取角色 Mesh Bridge 组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation") UPHYCharacterMeshBridgeComponent* GetMeshBridgeComponent() const { return MeshBridgeComponent; } - /** @brief 获取 SLS 角色运动组件。 */ + /** @brief 获取 SLS 角色运动组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion") USLSCharacterMovementComponent* GetSLSCharacterMovementComponent() const; - /** @brief 获取 SLS 集成入口组件。 */ + /** @brief 获取 SLS 集成入口组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion") USLSIntegrationComponent* GetSLSIntegrationComponent() const { return SLSIntegrationComponent; } - /** @brief 获取 GenericGameSystem 可选集成入口组件。 */ + /** @brief 获取 GenericGameSystem 可选集成入口组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Locomotion") UActorComponent* GetGenericIntegrationComponent() const { return GenericIntegrationComponent; } - /** @brief 获取显示层 Mesh 组件,职业和外观 Mesh 应应用到该组件。 */ + /** @brief 获取显示?Mesh 组件,职业和外观 Mesh 应应用到该组件?*/ UFUNCTION(BlueprintCallable, BlueprintPure, Category="PHY|Character|Animation") USkeletalMeshComponent* GetDisplayMeshComponent() const { return DisplayMeshComponent; } - /** @brief 获取当前战斗目标 Actor。 */ + /** @brief 获取当前战斗目标 Actor?*/ virtual AActor* GetCombatTargetActor_Implementation() const override; - /** @brief 获取连击定义表,首期骨架默认不绑定表。 */ + /** @brief 获取连击定义表,首期骨架默认不绑定表?*/ virtual const UDataTable* GetComboDefinitionTable_Implementation() const override; - /** @brief 获取当前战斗目标场景对象。 */ + /** @brief 获取当前战斗目标场景对象?*/ virtual USceneComponent* GetCombatTargetObject_Implementation() const override; - /** @brief 查询能力动作,首期骨架默认返回空。 */ + /** @brief 查询能力动作,首期骨架默认返回空?*/ virtual bool QueryAbilityActions_Implementation(FGameplayTagContainer AbilityTags, FGameplayTagContainer SourceTags, FGameplayTagContainer TargetTags, TArray& AbilityActions) override; - /** @brief 按上下文查询能力动作,首期骨架默认返回空。 */ + /** @brief 按上下文查询能力动作,首期骨架默认返回空?*/ virtual bool QueryAbilityActionsByContext_Implementation(UObject* Context, FGameplayTagContainer AbilityTags, FGameplayTagContainer SourceTags, FGameplayTagContainer TargetTags, TArray& AbilityActions) override; - /** @brief 按 Tag 查询当前武器。 */ + /** @brief ?Tag 查询当前武器?*/ virtual UObject* QueryWeapon_Implementation(const FGameplayTagQuery& Query) const override; - /** @brief 设置旋转模式。 */ + /** @brief 设置旋转模式?*/ virtual void SetRotationMode_Implementation(FGameplayTag NewRotationMode) override; - /** @brief 获取旋转模式。 */ + /** @brief 获取旋转模式?*/ virtual FGameplayTag GetRotationMode_Implementation() const override; - /** @brief 设置移动集合。 */ + /** @brief 设置移动集合?*/ virtual void SetMovementSet_Implementation(FGameplayTag NewMovementSet) override; - /** @brief 获取移动集合。 */ + /** @brief 获取移动集合?*/ virtual FGameplayTag GetMovementSet_Implementation() const override; - /** @brief 设置移动状态。 */ + /** @brief 设置移动状态?*/ virtual void SetMovementState_Implementation(FGameplayTag NewMovementState) override; - /** @brief 获取移动状态。 */ + /** @brief 获取移动状态?*/ virtual FGameplayTag GetMovementState_Implementation() const override; - /** @brief 开始死亡流程。 */ + /** @brief 开始死亡流程?*/ virtual void StartDeath_Implementation() override; - /** @brief 完成死亡流程。 */ + /** @brief 完成死亡流程?*/ virtual void FinishDeath_Implementation() override; - /** @brief 查询角色是否死亡。 */ + /** @brief 查询角色是否死亡?*/ virtual bool IsDead_Implementation() const override; - /** @brief 获取移动意图。 */ + /** @brief 获取移动意图?*/ virtual FVector GetMovementIntent_Implementation() const override; - /** @brief 获取当前武器。 */ + /** @brief 获取当前武器?*/ virtual UObject* GetCurrentWeapon_Implementation(UObject* Context = nullptr) const override; - /** @brief 设置当前武器。 */ + /** @brief 设置当前武器?*/ virtual void SetCurrentWeapon_Implementation(UObject* Weapon) override; - /** @brief 获取指定 Socket 的相对变换。 */ + /** @brief 获取指定 Socket 的相对变换?*/ 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 将输?Tag 映射?Ability Tag?*/ virtual FGameplayTag GetAbilityTagForInputTag(FGameplayTag InputTag) const; - /** @brief 应用 Character 配置默认值。 */ + /** @brief 应用 Character 配置默认值?*/ virtual void ApplyCharacterSettings(); - /** @brief 服务端同步移动意图。 */ + /** @brief 服务端同步移动意图?*/ UFUNCTION(Server, Unreliable) void ServerSetMovementIntent(FVector NewMovementIntent); - /** @brief 服务端设置战斗目标。 */ + /** @brief 服务端设置战斗目标?*/ UFUNCTION(Server, Reliable) void ServerSetCombatTargetActor(AActor* NewCombatTargetActor); - /** @brief 服务端执行开始交互。 */ + /** @brief 服务端执行开始交互?*/ UFUNCTION(Server, Reliable) void ServerRequestInteraction(int32 OptionIndex); - /** @brief 服务端执行即时交互。 */ + /** @brief 服务端执行即时交互?*/ UFUNCTION(Server, Reliable) void ServerRequestInstantInteraction(int32 OptionIndex); - /** @brief 服务端结束交互。 */ + /** @brief 服务端结束交互?*/ UFUNCTION(Server, Reliable) void ServerEndInteraction(); - /** @brief 服务端切换交互目标。 */ + /** @brief 服务端切换交互目标?*/ UFUNCTION(Server, Reliable) void ServerCycleInteractionTarget(bool bNext); - /** @brief 角色共享状态组件。 */ + /** @brief 角色共享状态组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr CharacterStateComponent; - /** @brief GCS 战斗系统组件。 */ + /** @brief GCS 战斗系统组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr CombatSystemComponent; - /** @brief GCS 目标系统组件。 */ + /** @brief GCS 目标系统组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr TargetingSystemComponent; - /** @brief GCS 战斗队伍代理组件。 */ + /** @brief GCS 战斗队伍代理组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr CombatTeamAgentComponent; - /** @brief GGS 交互系统组件。 */ + /** @brief GGS 交互系统组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr InteractionSystemComponent; - /** @brief GGS 布娃娃组件。 */ + /** @brief GGS 布娃娃组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr RagdollComponent; - /** @brief GES 上下文效果组件。 */ + /** @brief GES 上下文效果组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character") TObjectPtr ContextEffectComponent; - /** @brief 运动源 Mesh 与显示层 Mesh 的桥接组件。 */ + /** @brief 运动?Mesh 与显示层 Mesh 的桥接组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation") TObjectPtr MeshBridgeComponent; - /** @brief SLS 插件集成入口组件,由运动层集中接入。 */ + /** @brief SLS 插件集成入口组件,由运动层集中接入?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion") TObjectPtr SLSIntegrationComponent; - /** @brief GenericGameSystem 可选集成入口组件。 */ + /** @brief GenericGameSystem 可选集成入口组件?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Locomotion") TObjectPtr GenericIntegrationComponent; - /** @brief 显示层 Mesh 组件,承载职业和外观 Mesh。 */ + /** @brief 显示?Mesh 组件,承载职业和外观 Mesh?*/ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Character|Animation") TObjectPtr DisplayMeshComponent; - /** @brief 当前 Avatar 缓存的 ASC,玩家来自 PlayerState,AI 来自自身。 */ + /** @brief 当前 Avatar 缓存?ASC,玩家来?PlayerState,AI 来自自身?*/ UPROPERTY(Transient) TObjectPtr CachedAbilitySystemComponent; - /** @brief ASC 是否已经初始化为当前 Avatar。 */ + /** @brief ASC 是否已经初始化为当前 Avatar?*/ UPROPERTY(Transient) bool bAbilitySystemReady = false; }; diff --git a/Source/PHY/Public/Characters/PHYPlayerCharacter.h b/Source/PHY/Public/Characters/PHYPlayerCharacter.h index 0339819..dc401ac 100644 --- a/Source/PHY/Public/Characters/PHYPlayerCharacter.h +++ b/Source/PHY/Public/Characters/PHYPlayerCharacter.h @@ -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 CameraBoom; + TObjectPtr CameraBoom; /** @brief 玩家跟随相机。 */ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="PHY|Camera") diff --git a/Source/PHY/Public/GameplayTags/PHYGameplayTags_State.h b/Source/PHY/Public/GameplayTags/PHYGameplayTags_State.h index 8417c2a..362b23f 100644 --- a/Source/PHY/Public/GameplayTags/PHYGameplayTags_State.h +++ b/Source/PHY/Public/GameplayTags/PHYGameplayTags_State.h @@ -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); }