Esempio n. 1
0
    public static void ChangeMap(int mapId)
    {
        GameObject currentMap = GameObject.Find(AdventureGame.currentMap + "(Clone)");

        Destroy(currentMap);
        string     newMapName = Maps.FindMap(mapId).name;
        GameObject newMap     = (GameObject)Instantiate(Resources.Load("AdventureResources/Maps/" + newMapName));

        DontDestroyOnLoad(newMap);
        AdventureGame.currentMap = newMapName;
        AdventureGame.SaveGame();
    }