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();
|
||||
|
||||
gameInstance->GetCurrentLevelManager()->LoadNextLevel();
|
||||
gameInstance->GetCurrentLevelManager()->LoadNextLevel(NextLevel);
|
||||
|
||||
this->Destroy();
|
||||
}
|
||||
|
|
|
@ -14,6 +14,11 @@ class NAKATOMI_API ALevelEndTriggerVolume : public ATriggerBox
|
|||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
private:
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Meta = (AllowPrivateAccess = "true"))
|
||||
TSoftObjectPtr<UWorld> NextLevel;
|
||||
|
||||
protected:
|
||||
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())
|
||||
{
|
||||
|
|
|
@ -16,8 +16,6 @@ class NAKATOMI_API UNakatomiLevelManager : public UObject
|
|||
UNakatomiLevelManager();
|
||||
|
||||
private:
|
||||
UPROPERTY(EditDefaultsOnly, Meta = (AllowPrivateAccess = "true"))
|
||||
TSoftObjectPtr<UWorld> NextLevel;
|
||||
|
||||
int InitialLevelKeys = 0;
|
||||
|
||||
|
@ -25,7 +23,7 @@ private:
|
|||
|
||||
public:
|
||||
UFUNCTION()
|
||||
void LoadNextLevel();
|
||||
void LoadNextLevel(TSoftObjectPtr<UWorld> NextLevel);
|
||||
|
||||
UFUNCTION()
|
||||
void IncrementInitialLevelKeys();
|
||||
|
|
Loading…
Reference in New Issue