First commit
This commit is contained in:
34
Source/ProjectLighthouse/TP_PickUpComponent.h
Normal file
34
Source/ProjectLighthouse/TP_PickUpComponent.h
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/SphereComponent.h"
|
||||
#include "ProjectLighthouseCharacter.h"
|
||||
#include "TP_PickUpComponent.generated.h"
|
||||
|
||||
// Declaration of the delegate that will be called when someone picks this up
|
||||
// The character picking this up is the parameter sent with the notification
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnPickUp, AProjectLighthouseCharacter*, PickUpCharacter);
|
||||
|
||||
UCLASS(Blueprintable, BlueprintType, ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
|
||||
class PROJECTLIGHTHOUSE_API UTP_PickUpComponent : public USphereComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
/** Delegate to whom anyone can subscribe to receive this event */
|
||||
UPROPERTY(BlueprintAssignable, Category = "Interaction")
|
||||
FOnPickUp OnPickUp;
|
||||
|
||||
UTP_PickUpComponent();
|
||||
protected:
|
||||
|
||||
/** Called when the game starts */
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
/** Code for when something overlaps this component */
|
||||
UFUNCTION()
|
||||
void OnSphereBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
|
||||
};
|
||||
Reference in New Issue
Block a user