From accf4cce15026095547fb53899cd1f89515b72ad Mon Sep 17 00:00:00 2001 From: Caleb Buhungiro Date: Wed, 18 Jun 2025 17:48:06 +0800 Subject: [PATCH] remove unused code and comments --- Content/Player/CPlayerCharacter_BP.uasset | 4 ++-- Source/Crunch/Private/Character/CCharacter.cpp | 15 --------------- .../Crunch/Public/Animations/CAnimInstance.h | 18 ++++++++---------- Source/Crunch/Public/Character/CCharacter.h | 9 +-------- .../Crunch/Public/Character/CPlayerCharacter.h | 5 ++--- .../Public/GAS/CAbilitySystemComponent.h | 1 + Source/Crunch/Public/GAS/CAttributeSet.h | 1 - .../Crunch/Public/Player/CPlayerController.h | 9 ++------- 8 files changed, 16 insertions(+), 46 deletions(-) diff --git a/Content/Player/CPlayerCharacter_BP.uasset b/Content/Player/CPlayerCharacter_BP.uasset index 5d91fd7..7ecaa6c 100644 --- a/Content/Player/CPlayerCharacter_BP.uasset +++ b/Content/Player/CPlayerCharacter_BP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ee1f1a8e0b363af824fdccb2b03f46f7924a51065b714e749a3977c94adcf859 -size 39859 +oid sha256:f01210916c27ea35e27938dd262ffe9ee7c99b2f3f4d6879dc548439726190f9 +size 30336 diff --git a/Source/Crunch/Private/Character/CCharacter.cpp b/Source/Crunch/Private/Character/CCharacter.cpp index e613d8c..0a3d7c6 100644 --- a/Source/Crunch/Private/Character/CCharacter.cpp +++ b/Source/Crunch/Private/Character/CCharacter.cpp @@ -27,21 +27,6 @@ void ACCharacter::ClientSideInit() CAbilitySystemComponent->InitAbilityActorInfo(this, this); } -void ACCharacter::BeginPlay() -{ - Super::BeginPlay(); -} - -void ACCharacter::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); -} - -void ACCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) -{ - Super::SetupPlayerInputComponent(PlayerInputComponent); -} - UAbilitySystemComponent* ACCharacter::GetAbilitySystemComponent() const { return CAbilitySystemComponent; diff --git a/Source/Crunch/Public/Animations/CAnimInstance.h b/Source/Crunch/Public/Animations/CAnimInstance.h index c2dd69f..552a833 100644 --- a/Source/Crunch/Public/Animations/CAnimInstance.h +++ b/Source/Crunch/Public/Animations/CAnimInstance.h @@ -6,9 +6,6 @@ #include "Animation/AnimInstance.h" #include "CAnimInstance.generated.h" -/** - * - */ UCLASS() class CRUNCH_API UCAnimInstance : public UAnimInstance { @@ -27,27 +24,28 @@ public: UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE bool IsNotMoving() const { return Speed == 0; } - + UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE float GetYawSpeed() const { return YawSpeed; } - + UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE float GetSmoothedYaw() const { return SmoothedYawSpeed; } - + UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE bool GetIsJumping() const { return bIsJumping; } - + UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE bool IsOnGround() const { return !bIsJumping; } - + UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE float GetLookYawOffset() const { return LookRotOffset.Yaw; } + UFUNCTION(BlueprintCallable, meta=(BlueprintThreadSafe)) FORCEINLINE float GetLookPitchOffset() const { return LookRotOffset.Pitch; } private: UPROPERTY() - class ACharacter* OwnerCharacter; + ACharacter* OwnerCharacter; UPROPERTY() class UCharacterMovementComponent* OwnerMovementComp; UPROPERTY() @@ -55,7 +53,7 @@ private: float YawSpeed{0.f}; float SmoothedYawSpeed{0.f}; bool bIsJumping{false}; - + UPROPERTY(EditAnywhere, Category="Animation") float YawSpeedSmoothLerpSpeed{1.f}; diff --git a/Source/Crunch/Public/Character/CCharacter.h b/Source/Crunch/Public/Character/CCharacter.h index 22a7fc1..6552f87 100644 --- a/Source/Crunch/Public/Character/CCharacter.h +++ b/Source/Crunch/Public/Character/CCharacter.h @@ -16,19 +16,12 @@ public: ACCharacter(); void ServerSideInit(); void ClientSideInit(); - -protected: - virtual void BeginPlay() override; - -public: - virtual void Tick(float DeltaTime) override; - - virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; /********************************************************************************************/ /* Gameplay Ability */ /********************************************************************************************/ public: virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; + private: UPROPERTY(EditDefaultsOnly, Category="Gameplay Effects") class UCAbilitySystemComponent* CAbilitySystemComponent; diff --git a/Source/Crunch/Public/Character/CPlayerCharacter.h b/Source/Crunch/Public/Character/CPlayerCharacter.h index 11d1b39..85f1037 100644 --- a/Source/Crunch/Public/Character/CPlayerCharacter.h +++ b/Source/Crunch/Public/Character/CPlayerCharacter.h @@ -32,7 +32,7 @@ private: UPROPERTY(EditDefaultsOnly, Category= "View") FRotator RotationRate{FRotator(0.0f, 720.0f, 0.0f)}; - + UPROPERTY(EditDefaultsOnly, Category= "Input") class UInputMappingContext* GameplayMappingContext; UPROPERTY(EditDefaultsOnly, Category= "Input") @@ -41,12 +41,11 @@ private: UInputAction* LookInputAction; UPROPERTY(EditDefaultsOnly, Category= "Input") UInputAction* MoveInputAction; - + void HandleLookInput(const FInputActionValue& InputActionValue); void HandleMoveInput(const FInputActionValue& InputActionValue); FVector GetLookRightDir() const; FVector GetLookFwdDir() const; FVector GetMoveFwdDir() const; - }; diff --git a/Source/Crunch/Public/GAS/CAbilitySystemComponent.h b/Source/Crunch/Public/GAS/CAbilitySystemComponent.h index 1ef37d0..922f098 100644 --- a/Source/Crunch/Public/GAS/CAbilitySystemComponent.h +++ b/Source/Crunch/Public/GAS/CAbilitySystemComponent.h @@ -15,6 +15,7 @@ class CRUNCH_API UCAbilitySystemComponent : public UAbilitySystemComponent public: void ApplyInitialEffects(); + private: UPROPERTY(EditDefaultsOnly, Category="Gameplay Effects") TArray> InitialEffects; diff --git a/Source/Crunch/Public/GAS/CAttributeSet.h b/Source/Crunch/Public/GAS/CAttributeSet.h index 8855b54..465bf82 100644 --- a/Source/Crunch/Public/GAS/CAttributeSet.h +++ b/Source/Crunch/Public/GAS/CAttributeSet.h @@ -65,4 +65,3 @@ private: UFUNCTION() void OnRep_MaxMana(const FGameplayAttributeData& OldValue); }; - diff --git a/Source/Crunch/Public/Player/CPlayerController.h b/Source/Crunch/Public/Player/CPlayerController.h index 96ad218..1d56f75 100644 --- a/Source/Crunch/Public/Player/CPlayerController.h +++ b/Source/Crunch/Public/Player/CPlayerController.h @@ -6,21 +6,16 @@ #include "GameFramework/PlayerController.h" #include "CPlayerController.generated.h" -/** - * - */ UCLASS() class CRUNCH_API ACPlayerController : public APlayerController { GENERATED_BODY() + public: - // Only called on the server virtual void OnPossess(APawn* InPawn) override; - // Only called on the client, also on the listening server virtual void AcknowledgePossession(class APawn* P) override; - + private: UPROPERTY() class ACPlayerCharacter* CPlayerCharacter; - };