basically the whole game
This commit is contained in:
parent
949135cecb
commit
96dcfa9064
315 changed files with 34386 additions and 396 deletions
28
Assets/Scripts/LevelSwitcher.cs
Normal file
28
Assets/Scripts/LevelSwitcher.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class LevelSwitcher : MonoBehaviour
|
||||
{
|
||||
#region Statication
|
||||
|
||||
public static LevelSwitcher instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public DialogueScript currentScript;
|
||||
public void SwitchLevel(int sceneIndex, DialogueScript scriptToShow = null)
|
||||
{
|
||||
currentScript = scriptToShow;
|
||||
SceneManager.LoadScene(sceneIndex);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue