Compare commits
2 Commits
b2dc5b86f7
...
b8c22c9d36
Author | SHA1 | Date |
---|---|---|
baz | b8c22c9d36 | |
baz | c0d57dac8e |
BIN
Content/Levels/Level1/Level1.umap (Stored with Git LFS)
BIN
Content/Levels/Level1/Level1.umap (Stored with Git LFS)
Binary file not shown.
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "LevelKeyPickup.h"
|
#include "LevelKeyPickup.h"
|
||||||
#include "NakatomiGameInstance.h"
|
#include "NakatomiGameInstance.h"
|
||||||
|
#include "PlayerCharacter.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
|
||||||
void ALevelKeyPickup::BeginPlay()
|
void ALevelKeyPickup::BeginPlay()
|
||||||
|
@ -23,10 +24,13 @@ void ALevelKeyPickup::Tick(float DeltaTime)
|
||||||
void ALevelKeyPickup::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
void ALevelKeyPickup::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
||||||
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
|
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
|
||||||
{
|
{
|
||||||
if (auto gameInstance = Cast<UNakatomiGameInstance>(UGameplayStatics::GetGameInstance(GetWorld())))
|
if (Cast<APlayerCharacter>(OtherActor))
|
||||||
{
|
{
|
||||||
gameInstance->GetCurrentLevelManager()->IncrementCollectedLevelKeys();
|
if (auto gameInstance = Cast<UNakatomiGameInstance>(UGameplayStatics::GetGameInstance(GetWorld())))
|
||||||
}
|
{
|
||||||
|
gameInstance->GetCurrentLevelManager()->IncrementCollectedLevelKeys();
|
||||||
|
}
|
||||||
|
|
||||||
Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
|
Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue