//Loads the last clicked Level from the Level Select menu. public void LoadSelectedLevel() { if (selectedLevel.Equals("")) { return; } levelToLoad = LevelIOManager.LoadLevel(selectedLevel, false); levelSelectMenu.SetActive(false); LevelIOManager.ConstructLevelInCanvas(levelCanvas, levelToLoad); }
public void ClickToTest() { Debug.Log(Application.persistentDataPath); foreach (string name in LevelIOManager.GetBuiltInLevelNames(false)) { Debug.Log("Builtin: " + name); } foreach (string name in LevelIOManager.GetBuiltInLevelNames(true)) { Debug.Log("Custom: " + name); } }
void OnLevelWasLoaded(int level) { inroom = level; if (level == 0) { //main menu Destroy(gameObject); } else if (level == 2) { //lobby GameObject.Find("LobbyMenu").GetComponent <LobbyMenuManager>().NavigateTo("Lobby"); } else if (level == 3) { //in multiplayer game Debug.Log("Loading Level " + toLoad); LevelIOManager.ContructLevelInCanvasByName(GameObject.Find("Level"), toLoad, isCustom); if (matchTime == 0) { GameObject.Find("Ingame Manager").GetComponent <Referee>().isTimed = false; } else { GameObject.Find("Ingame Manager").GetComponent <Referee>().isTimed = true; } GameObject.Find("Ingame Manager").GetComponent <Referee>().timer = matchTime; levelScaleManager = FindObjectOfType <LevelScaleManager>(); spawnPlayer(usingSkin); } else if (level == 4) { //prep if (Network.isServer) { Network.maxConnections = matchMaxUsers - 1; } for (int i = 0; i < 8; ++i) { PlayerWinOrder[i] = null; } } }
//Constructs a level in the provided Level prefab canvas by looking for a level of the given name. public static void ContructLevelInCanvasByName(GameObject levelCanvas, string levelName, bool isCustom) { Level levelToLoad = LevelIOManager.LoadLevel(levelName, isCustom); ConstructLevelInCanvas(levelCanvas, levelToLoad); }
public void SaveLevel() { LevelIOManager.BuildLevelPrimitiveAndSaveLevel(levelToEdit, levelName, levelWidth, levelHeight, levelGravity, levelBorder); }