Implemented Checkpoint Class Functionality
This commit is contained in:
		
							parent
							
								
									51cc5b8930
								
							
						
					
					
						commit
						44e0a6bc2d
					
				@ -6,21 +6,65 @@
 | 
				
			|||||||
#include "GameFramework/Actor.h"
 | 
					#include "GameFramework/Actor.h"
 | 
				
			||||||
#include "CheckpointClass.generated.h"
 | 
					#include "CheckpointClass.generated.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedCheckpoint);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
UCLASS()
 | 
					UCLASS()
 | 
				
			||||||
class ENDLESSVENDETTA_API ACheckpointClass : public AActor
 | 
					class ENDLESSVENDETTA_API ACheckpointClass : public AActor
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	GENERATED_BODY()
 | 
						GENERATED_BODY()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:	
 | 
						// ------ Properties set from Editor ------
 | 
				
			||||||
	// Sets default values for this actor's properties
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
 | 
				
			||||||
	ACheckpointClass();
 | 
						FString CheckpointDescription;
 | 
				
			||||||
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
 | 
				
			||||||
 | 
						FVector WaypointLoc;
 | 
				
			||||||
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
 | 
				
			||||||
 | 
						UTexture2D* WaypointIcon;
 | 
				
			||||||
 | 
						UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
 | 
				
			||||||
 | 
						FTransform CheckpointSpawnTransform;
 | 
				
			||||||
 | 
						// ----------------------------------------
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						UFUNCTION(BlueprintCallable, Category = "Checkpoint")
 | 
				
			||||||
 | 
						void BroadcastCompletion()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							CompletedCheckpoint.Broadcast();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
	// Called when the game starts or when spawned
 | 
						// Called when the game starts or when spawned
 | 
				
			||||||
	virtual void BeginPlay() override;
 | 
						virtual void BeginPlay() override;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
 | 
						FCompletedCheckpoint CompletedCheckpoint;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						UPROPERTY(BlueprintReadOnly, Category = "Checkpoint")
 | 
				
			||||||
 | 
						bool Active = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// ------ Getters for CP Properties ------
 | 
				
			||||||
 | 
						FString GetCheckpointDesc()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return CheckpointDescription;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						FVector GetWaypointLoc()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return WaypointLoc;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						UTexture2D* GetWaypointIcon()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return WaypointIcon;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						FTransform GetCheckpointSpawnTransform()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return CheckpointSpawnTransform;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						// ---------------------------------------
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						// Sets default values for this actor's properties
 | 
				
			||||||
 | 
						ACheckpointClass();
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	// Called every frame
 | 
						// Called every frame
 | 
				
			||||||
	virtual void Tick(float DeltaTime) override;	
 | 
						virtual void Tick(float DeltaTime) override;	
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user