public void handleLoadLevelMessage(string msg)
    {
        LoadLevelMessage m = JsonUtility.FromJson <LoadLevelMessage>(msg);

        if (m.level == SceneManager.GetActiveScene().name)
        {
            hero  = GameObject.Find("Hero(Clone)");
            dummy = GameObject.Find("Dummy(Clone)");

            //clear keycards obtained in this level
            if (hero != null)
            {
                hero.GetComponent <HeroController>().HasRedKeyCard  = false;
                hero.GetComponent <HeroController>().HasBlueKeyCard = false;
            }

            if (dummy != null)
            {
                dummy.GetComponent <DummyController>().HasRedKeyCard  = false;
                dummy.GetComponent <DummyController>().HasBlueKeyCard = false;
            }

            WorldController.RestartLevel();
        }

        WorldController.ChangeScene(m.level);
    }
    public bool sendLoadLevelMessage(string level)
    {
        LoadLevelMessage msg = new LoadLevelMessage();

        msg.level = level;

        sendJSON(msg);
        return(true);
    }