Skip to content

Commit

Permalink
Change: BP_CheckPoint; Add: BP_Beacon; Change: CheckPoint cpp file; B…
Browse files Browse the repository at this point in the history
…eacons;
  • Loading branch information
FHangH committed Nov 11, 2024
1 parent 0b19280 commit a82ff10
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
Binary file added Content/BP/Actor/CheckPoint/BP_Beacon.uasset
Binary file not shown.
Binary file modified Content/BP/Actor/CheckPoint/BP_CheckPoint.uasset
Binary file not shown.
Binary file modified Content/Maps/Dungeon.umap
Binary file not shown.
10 changes: 6 additions & 4 deletions Source/GAS_Aura/Private/Gameplay/Actor/CheckPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "Gameplay/GameMode/AuraGameModeBase.h"
#include "Interaction/PlayerInterface.h"
#include "Kismet/GameplayStatics.h"
#include "Untils/RenderDepth.h"

ACheckPoint::ACheckPoint(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
Expand All @@ -17,7 +16,7 @@ ACheckPoint::ACheckPoint(const FObjectInitializer& ObjectInitializer) : Super(Ob
CheckPointMeshComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
CheckPointMeshComponent->SetCollisionResponseToAllChannels(ECR_Block);
CheckPointMeshComponent->SetRenderCustomDepth(false);
CheckPointMeshComponent->SetCustomDepthStencilValue(RENDER_DEPTH_TAN);
CheckPointMeshComponent->SetCustomDepthStencilValue(CustomRenderDepth);
CheckPointMeshComponent->MarkRenderStateDirty();

SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("SphereComponent"));
Expand All @@ -34,7 +33,10 @@ void ACheckPoint::BeginPlay()
{
Super::BeginPlay();

SphereComponent->OnComponentBeginOverlap.AddDynamic(this, &ACheckPoint::OnSphereStartOverlap);
if (IsBindOverlapCallBack)
{
SphereComponent->OnComponentBeginOverlap.AddDynamic(this, &ACheckPoint::OnSphereStartOverlap);
}
}

// Save Interface
Expand All @@ -54,7 +56,7 @@ void ACheckPoint::LoadActor_Implementation()
// HighLight Interface
void ACheckPoint::HighLightActor_Implementation()
{
if (CheckPointMeshComponent)
if (CheckPointMeshComponent && !IsReached)
{
CheckPointMeshComponent->SetRenderCustomDepth(true);
}
Expand Down
17 changes: 12 additions & 5 deletions Source/GAS_Aura/Public/Gameplay/Actor/CheckPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "GameFramework/PlayerStart.h"
#include "Interaction/HighLightInterface.h"
#include "Interaction/SaveInterface.h"
#include "Untils/RenderDepth.h"
#include "CheckPoint.generated.h"

class USphereComponent;
Expand All @@ -17,19 +18,25 @@ class GAS_AURA_API ACheckPoint : public APlayerStart, public ISaveInterface, pub

/* Property */
private:
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Aura|CheckPoint", meta=(AllowPrivateAccess=true))
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category="Aura|CheckPoint", meta=(AllowPrivateAccess=true))
TObjectPtr<UStaticMeshComponent> CheckPointMeshComponent;

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Aura|CheckPoint", meta=(AllowPrivateAccess=true))
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category="Aura|CheckPoint", meta=(AllowPrivateAccess=true))
TObjectPtr<USphereComponent> SphereComponent;

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Aura|CheckPoint", meta=(AllowPrivateAccess=true))
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category="Aura|CheckPoint", meta=(AllowPrivateAccess=true))
TObjectPtr<USceneComponent> MoveToSceneComponent;

public:
UPROPERTY(BlueprintReadOnly, SaveGame, Category="Aura|CheckPoint")
UPROPERTY(BlueprintReadWrite, SaveGame, Category="Aura|CheckPoint")
bool IsReached { false };

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Aura|CheckPoint")
int32 CustomRenderDepth { RENDER_DEPTH_TAN };

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Aura|CheckPoint")
bool IsBindOverlapCallBack { true };

/* Function */
public:
explicit ACheckPoint(const FObjectInitializer& ObjectInitializer);
Expand All @@ -54,6 +61,6 @@ class GAS_AURA_API ACheckPoint : public APlayerStart, public ISaveInterface, pub
UFUNCTION(BlueprintNativeEvent, Category="Aura|CheckPoint")
void CheckPointReached(UMaterialInstanceDynamic* MaterialInstanceDynamic);

UFUNCTION()
UFUNCTION(BlueprintCallable, Category="Aura|CheckPoint")
void HandleGlowEffects();
};

0 comments on commit a82ff10

Please sign in to comment.