feat(player-controller): 实现v0.1角色控制系统
- 移除跳跃逻辑:删除JumpAction、DoJumpStart/End - 调整CMC参数:MaxWalkSpeed=450, Acceleration=2250, Brake=1500, RotationRate=720 - 调整SpringArm:TargetArmLength=350, SocketOffset.Z=80, CameraLag=6, ProbeSize=12 - 添加Pitch限幅:ViewPitchMin=-30, ViewPitchMax=45, 初始俯角-15° - 新增交互状态:bIsInteracting + SetInteracting/IsInteracting/IsRunning - 新增交互IA:InteractAction/CancelAction/SwitchInteractAction(占位回调) - DoMove添加交互中忽略移动输入检查 Task: P-011
This commit is contained in:
@@ -30,12 +30,8 @@ class AChildHoodCharacter : public ACharacter
|
||||
/** Follow camera */
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components", meta = (AllowPrivateAccess = "true"))
|
||||
UCameraComponent* FollowCamera;
|
||||
|
||||
protected:
|
||||
|
||||
/** Jump Input Action */
|
||||
UPROPERTY(EditAnywhere, Category="Input")
|
||||
UInputAction* JumpAction;
|
||||
protected:
|
||||
|
||||
/** Move Input Action */
|
||||
UPROPERTY(EditAnywhere, Category="Input")
|
||||
@@ -49,10 +45,25 @@ protected:
|
||||
UPROPERTY(EditAnywhere, Category="Input")
|
||||
UInputAction* MouseLookAction;
|
||||
|
||||
/** Interact Input Action (E key) — delegates to interaction system */
|
||||
UPROPERTY(EditAnywhere, Category="Input")
|
||||
UInputAction* InteractAction;
|
||||
|
||||
/** Cancel Input Action (ESC key) — delegates to interaction system */
|
||||
UPROPERTY(EditAnywhere, Category="Input")
|
||||
UInputAction* CancelAction;
|
||||
|
||||
/** Switch Interact Target Input Action (Tab / Mouse Wheel) — delegates to interaction system */
|
||||
UPROPERTY(EditAnywhere, Category="Input")
|
||||
UInputAction* SwitchInteractAction;
|
||||
|
||||
/** Whether the character is currently in an interaction */
|
||||
bool bIsInteracting = false;
|
||||
|
||||
public:
|
||||
|
||||
/** Constructor */
|
||||
AChildHoodCharacter();
|
||||
AChildHoodCharacter();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -67,6 +78,15 @@ protected:
|
||||
/** Called for looking input */
|
||||
void Look(const FInputActionValue& Value);
|
||||
|
||||
/** Called for interact input (E) — placeholder, delegates to interaction system */
|
||||
void OnInteract(const FInputActionValue& Value);
|
||||
|
||||
/** Called for cancel input (ESC) — placeholder, delegates to interaction system */
|
||||
void OnCancel(const FInputActionValue& Value);
|
||||
|
||||
/** Called for switch interact target input (Tab/Wheel) — placeholder, delegates to interaction system */
|
||||
void OnSwitchInteract(const FInputActionValue& Value);
|
||||
|
||||
public:
|
||||
|
||||
/** Handles move inputs from either controls or UI interfaces */
|
||||
@@ -77,13 +97,17 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category="Input")
|
||||
virtual void DoLook(float Yaw, float Pitch);
|
||||
|
||||
/** Handles jump pressed inputs from either controls or UI interfaces */
|
||||
UFUNCTION(BlueprintCallable, Category="Input")
|
||||
virtual void DoJumpStart();
|
||||
/** Set interaction state — called by interaction system */
|
||||
UFUNCTION(BlueprintCallable, Category="Interaction")
|
||||
void SetInteracting(bool bValue);
|
||||
|
||||
/** Handles jump pressed inputs from either controls or UI interfaces */
|
||||
UFUNCTION(BlueprintCallable, Category="Input")
|
||||
virtual void DoJumpEnd();
|
||||
/** Query: is the character currently interacting? */
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Interaction")
|
||||
bool IsInteracting() const;
|
||||
|
||||
/** Query: is the character currently running (moving on ground)? */
|
||||
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Interaction")
|
||||
bool IsRunning() const;
|
||||
|
||||
public:
|
||||
|
||||
@@ -93,4 +117,3 @@ public:
|
||||
/** Returns FollowCamera subobject **/
|
||||
FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user