第一次提交
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Animation/AnimNotifies/AnimNotifyState.h"
|
||||
#include "GCS_ANS_AttackTrace.generated.h"
|
||||
|
||||
class UGCS_AttackRequest_Melee;
|
||||
|
||||
/**
|
||||
* Animation notify state for melee attack tracing.
|
||||
* 近战攻击追踪的动画通知状态。
|
||||
*/
|
||||
UCLASS(BlueprintType, Blueprintable, HideDropdown)
|
||||
class GENERICCOMBATSYSTEM_API UGCS_ANS_AttackTrace : public UAnimNotifyState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Default constructor.
|
||||
* 默认构造函数。
|
||||
*/
|
||||
UGCS_ANS_AttackTrace(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
/**
|
||||
* Called after properties are initialized.
|
||||
* 属性初始化后调用。
|
||||
*/
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
/**
|
||||
* The melee attack request instance.
|
||||
* 近战攻击请求实例。
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Instanced, Category=Parameters)
|
||||
TObjectPtr<UGCS_AttackRequest_Melee> AttackRequest;
|
||||
|
||||
#if WITH_EDITORONLY_DATA
|
||||
/**
|
||||
* Called before saving to validate data.
|
||||
* 保存前调用以验证数据。
|
||||
*/
|
||||
virtual void PreSave(FObjectPreSaveContext SaveContext) override;
|
||||
#endif
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Animation/AnimNotifies/AnimNotifyState.h"
|
||||
#include "GCS_ANS_BulletTrace.generated.h"
|
||||
|
||||
class UGCS_AttackRequest_Bullet;
|
||||
class UTargetingPreset;
|
||||
|
||||
/**
|
||||
* Animation notify state for bullet attack tracing.
|
||||
* 子弹攻击追踪的动画通知状态。
|
||||
*/
|
||||
UCLASS(BlueprintType, Blueprintable, HideDropdown)
|
||||
class GENERICCOMBATSYSTEM_API UGCS_ANS_BulletTrace : public UAnimNotifyState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
* 默认构造函数。
|
||||
*/
|
||||
UGCS_ANS_BulletTrace(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
/**
|
||||
* The bullet attack request instance.
|
||||
* 子弹攻击请求实例。
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Instanced, Category=Parameters)
|
||||
TObjectPtr<UGCS_AttackRequest_Bullet> AttackRequest;
|
||||
|
||||
#if WITH_EDITOR
|
||||
/**
|
||||
* Validates data for the notify.
|
||||
* 验证通知数据。
|
||||
* @param Context The validation context. 验证上下文。
|
||||
* @return The validation result. 验证结果。
|
||||
*/
|
||||
virtual EDataValidationResult IsDataValid(FDataValidationContext& Context) const override;
|
||||
|
||||
/**
|
||||
* Called before saving to validate data.
|
||||
* 保存前调用以验证数据。
|
||||
*/
|
||||
virtual void PreSave(FObjectPreSaveContext SaveContext) override;
|
||||
#endif
|
||||
};
|
||||
@@ -0,0 +1,74 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Animation/AnimNotifies/AnimNotify.h"
|
||||
#include "Animation/AnimNotifies/AnimNotifyState.h"
|
||||
#include "GCS_ANS_MovementCancellation.generated.h"
|
||||
|
||||
/**
|
||||
* Animation notify state to disable montage root motion when moving.
|
||||
* 当角色移动时禁用蒙太奇根运动的动画通知状态。
|
||||
*/
|
||||
UCLASS(BlueprintType, Blueprintable, Abstract, HideDropdown)
|
||||
class GENERICCOMBATSYSTEM_API UGCS_ANS_MovementCancellation : public UAnimNotifyState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
* 默认构造函数。
|
||||
*/
|
||||
UGCS_ANS_MovementCancellation(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
/**
|
||||
* Called when the notify begins.
|
||||
* 通知开始时调用。
|
||||
* @param BranchingPointPayload The notify payload. 通知载荷。
|
||||
*/
|
||||
virtual void BranchingPointNotifyBegin(FBranchingPointNotifyPayload& BranchingPointPayload) override;
|
||||
|
||||
/**
|
||||
* Called each frame during the notify.
|
||||
* 通知期间每帧调用。
|
||||
* @param BranchingPointPayload The notify payload. 通知载荷。
|
||||
* @param FrameDeltaTime Time since last frame. 上一帧以来的时间。
|
||||
*/
|
||||
virtual void BranchingPointNotifyTick(FBranchingPointNotifyPayload& BranchingPointPayload, float FrameDeltaTime) override;
|
||||
|
||||
/**
|
||||
* Called when the notify ends.
|
||||
* 通知结束时调用。
|
||||
* @param BranchingPointPayload The notify payload. 通知载荷。
|
||||
*/
|
||||
virtual void BranchingPointNotifyEnd(FBranchingPointNotifyPayload& BranchingPointPayload) override;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Checks if the skeletal mesh is moving.
|
||||
* 检查骨骼网格是否在移动。
|
||||
* @param MeshComp The skeletal mesh component. 骨骼网格组件。
|
||||
* @return True if moving. 如果在移动返回true。
|
||||
*/
|
||||
UFUNCTION(BlueprintNativeEvent)
|
||||
bool IsMoving(USkeletalMeshComponent* MeshComp) const;
|
||||
virtual bool IsMoving_Implementation(USkeletalMeshComponent* MeshComp) const;
|
||||
|
||||
/**
|
||||
* Indicates if root motion is disabled.
|
||||
* 表示根运动是否被禁用。
|
||||
*/
|
||||
bool IsRootMotionDisabled{false};
|
||||
|
||||
#if WITH_EDITOR
|
||||
/**
|
||||
* Checks if the notify can be placed on an animation.
|
||||
* 检查通知是否可以放置在动画上。
|
||||
* @param Animation The animation sequence. 动画序列。
|
||||
* @return True if valid. 如果有效返回true。
|
||||
*/
|
||||
virtual bool CanBePlaced(UAnimSequenceBase* Animation) const override;
|
||||
#endif
|
||||
};
|
||||
Reference in New Issue
Block a user