Move NextLevel referene to LevelEndTriggerVolume
This commit is contained in:
parent
18ab3a5434
commit
95aa4285e3
|
@ -35,7 +35,7 @@ void ALevelEndTriggerVolume::OnOverlapBegin(UPrimitiveComponent* OverlappedCompo
|
||||||
{
|
{
|
||||||
GetCollisionComponent()->OnComponentBeginOverlap.Clear();
|
GetCollisionComponent()->OnComponentBeginOverlap.Clear();
|
||||||
|
|
||||||
gameInstance->GetCurrentLevelManager()->LoadNextLevel();
|
gameInstance->GetCurrentLevelManager()->LoadNextLevel(NextLevel);
|
||||||
|
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,11 @@ class NAKATOMI_API ALevelEndTriggerVolume : public ATriggerBox
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly, Meta = (AllowPrivateAccess = "true"))
|
||||||
|
TSoftObjectPtr<UWorld> NextLevel;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ void UNakatomiLevelManager::BeginPlay(UWorld* world)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UNakatomiLevelManager::LoadNextLevel()
|
void UNakatomiLevelManager::LoadNextLevel(TSoftObjectPtr<UWorld> NextLevel)
|
||||||
{
|
{
|
||||||
if (!NextLevel.IsNull())
|
if (!NextLevel.IsNull())
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,8 +16,6 @@ class NAKATOMI_API UNakatomiLevelManager : public UObject
|
||||||
UNakatomiLevelManager();
|
UNakatomiLevelManager();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(EditDefaultsOnly, Meta = (AllowPrivateAccess = "true"))
|
|
||||||
TSoftObjectPtr<UWorld> NextLevel;
|
|
||||||
|
|
||||||
int InitialLevelKeys = 0;
|
int InitialLevelKeys = 0;
|
||||||
|
|
||||||
|
@ -25,7 +23,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void LoadNextLevel();
|
void LoadNextLevel(TSoftObjectPtr<UWorld> NextLevel);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void IncrementInitialLevelKeys();
|
void IncrementInitialLevelKeys();
|
||||||
|
|
Loading…
Reference in New Issue