public void ResetLevel()
    {
        map.RestartLevel();

        if (EUpdateMinibotCount != null && EUpdateMinibotCount.GetInvocationList().Length > 0)
        {
            EUpdateMinibotCount();                                      // We update the Minibot Count
        }
        if (ELevelStarted != null && ELevelStarted.GetInvocationList().Length > 0)
        {
            ELevelStarted();
        }
    }
    // ************************************************************************************
    // END GAME LOGIC
    // ************************************************************************************

    public void OnMinibotExit()
    {
        if (EUpdateMinibotCount != null && EUpdateMinibotCount.GetInvocationList().Length > 0)
        {
            EUpdateMinibotCount();
        }

        int minibotsLeft = CountMinibotsInLevel();

        if (minibotsLeft <= 0)
        {
            LevelCompleted();
        }
    }
    public void StartLevel()
    {
        if (!Registry.replayViewer.enabled)
        {
            Registry.replayManager.StopReplay();
            Registry.replayManager.StartRecording();
        }

        isReplayMode = false;

        if (EUpdateMinibotCount != null && EUpdateMinibotCount.GetInvocationList().Length > 0)
        {
            EUpdateMinibotCount();                                      // We update the Minibot Count
        }
        if (ELevelStarted != null && ELevelStarted.GetInvocationList().Length > 0)
        {
            ELevelStarted();
        }
    }