Compare commits
No commits in common. "b8c22c9d3657e14e2809bdb84b29ac5448ae96ef" and "b2dc5b86f74cd6f203f3cde4f3c3f129a7768712" have entirely different histories.
b8c22c9d36
...
b2dc5b86f7
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,7 +3,6 @@
|
||||||
|
|
||||||
#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()
|
||||||
|
@ -19,18 +18,15 @@ void ALevelKeyPickup::BeginPlay()
|
||||||
void ALevelKeyPickup::Tick(float DeltaTime)
|
void ALevelKeyPickup::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(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 (Cast<APlayerCharacter>(OtherActor))
|
if (auto gameInstance = Cast<UNakatomiGameInstance>(UGameplayStatics::GetGameInstance(GetWorld())))
|
||||||
{
|
{
|
||||||
if (auto gameInstance = Cast<UNakatomiGameInstance>(UGameplayStatics::GetGameInstance(GetWorld())))
|
gameInstance->GetCurrentLevelManager()->IncrementCollectedLevelKeys();
|
||||||
{
|
|
||||||
gameInstance->GetCurrentLevelManager()->IncrementCollectedLevelKeys();
|
|
||||||
}
|
|
||||||
|
|
||||||
Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue