// Update is called once per frame
 void Update()
 {
     if (PrototypeGoal.goalMet && mode == P_GAMEMODE.playing)
     {
         mode = P_GAMEMODE.levelEnd;
         Invoke("NextWorld", 3f);
     }
 }
    private void InitializeWorld()
    {
        if (world != null)
        {
            Destroy(world);
        }

        world = Instantiate <GameObject>(worlds[levelCurrent]);
        PlayerController.ResetCoins();
        PrototypeGoal.goalMet = false;

        coins      = GameObject.FindGameObjectsWithTag("Coin");
        totalCoins = coins.Length;

        UpdateGUI();
        mode = P_GAMEMODE.playing;

        isNewWorld = true;
        Invoke("notNewWorld", 0.1f);
    }