literally half of the game
This commit is contained in:
parent
1590b5faa6
commit
b842289076
77 changed files with 11904 additions and 72 deletions
37
Assets/Scripts/LevelSwitcher.cs
Normal file
37
Assets/Scripts/LevelSwitcher.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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;
|
||||
}
|
||||
DontDestroyOnLoad(this);
|
||||
instance = this;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[SerializeField] private int mapSceneIndex;
|
||||
public void LoadMap(Map requestedMap, int exitIndex)
|
||||
{
|
||||
SceneManager.LoadScene(mapSceneIndex);
|
||||
Map newMap = Instantiate(requestedMap);
|
||||
newMap.Load();
|
||||
//load player and set to exit position
|
||||
|
||||
}
|
||||
|
||||
public void SwitchMenu(int sceneIndex)
|
||||
{
|
||||
SceneManager.LoadScene(sceneIndex);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue