Exemplo n.º 1
0
    /// <summary>
    /// Needed so MainGUI doesnt go on top of MainMenu
    /// </summary>
    internal void ReLoadMainMenuIfActive()
    {
        var forms = FindObjectsOfType <MyForm>();

        for (int i = 0; i < forms.Length; i++)
        {
            if (forms[i] != null && forms[i].MyId.Contains("MainMenu"))
            {
                RedifineWindows();
                _mainMenuWindow.Destroy();
                _mainMenuWindow = null;

                _newGameWindow.Destroy();
                _newGameWindow = null;

                SaveLoadGameWindow.Destroy();
                SaveLoadGameWindow = null;

                _optionsWindow.Destroy();
                _optionsWindow = null;

                if (_achieveWindow)
                {
                    _achieveWindow.Destroy();
                    _achieveWindow = null;
                }

                DestroyCurrentMenu();
                LoadMainMenu();
                Debug.Log("Reload Main Menu  ReLoadMainMenuIfActive");

                RedifineWindows();
            }
        }
    }