IEnumerator NextMap()
    {
        s_camera.staticCam.StartCoroutine(s_camera.staticCam.Fade(Color.black, 5));
        s_levelloader lo = s_levelloader.load;

        Grid.ClearGrid();
        game_on = false;
        if (lo.currentlevel == lo.LevelData.Count - 1)
        {
            PlayerPrefs.SetInt("GameCompleted", 1);
            PlayerPrefs.Save();
            UnityEngine.SceneManagement.SceneManager.LoadScene("Title");
        }

        lo.currentlevel++;
        int curlev = lo.currentlevel;

        PlayerPrefs.SetInt("CurrentLevel", curlev);
        PlayerPrefs.Save();
        yield return(new WaitForSeconds(1f));

        s_camera.staticCam.StartCoroutine(s_camera.staticCam.Fade(Color.clear, 5));
        s_levelloader.load.LoadData();
        //Grid.Initialize();
        InitCharacters();
        game_on = true;
    }
    public void LoadData(string dire)
    {
        string te = "";

        te = File.ReadAllText(dire);
        Grid.ClearGrid();

        Debug.Log(dire);
        s_leveldat leveldata = JsonUtility.FromJson <s_leveldat>(te);

        Grid.groundworldsize = leveldata.gridsize;

        load.FeedGridData(leveldata);
        Grid.UnpaintAllNodes();
    }