Files
2026-01-21 10:56:26 -07:00

46 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
//Designed by Jacob Weedman
//Belongs to the "WorldManager" GameObject in the "LevelSelector" scene
//V 0.0.1
public class WorldManager : MonoBehaviour
{
string[] LevelsCompleted;
string levelChosen;
public string currentSector;
void Update()
{
if (GameObject.Find("GameData").GetComponent<GameData>().CurrentSector == "0")
{
GameObject.Find("GameData").GetComponent<GameData>().CurrentSector = "1";
}
currentSector = GameObject.Find("CurrentSector").tag;
levelChosen = tag;
if ((currentSector != "Untagged") && (levelChosen != "Untagged"))
{
ChangeLevel();
}
}
void ChangeLevel()
{
if (levelChosen == "test") // Remove later when levels are put in place
{
//SceneManager.LoadScene("WorkingPathfindingTest");
//SceneManager.LoadScene("Sector1Boss");
SceneManager.LoadScene("BossFightSelector");
}
else
{
SceneManager.LoadScene("Sector" + currentSector + "Level" + levelChosen);
}
}
}