コード例 #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();
            }
        }
    }
コード例 #2
0
 public void DeleteSavedGameCallBack()
 {
     RedifineWindows();
     SaveLoadGameWindow.DeleteCallBack();
 }
コード例 #3
0
    /// <summary>
    /// Depending on the btn was clicked will do action
    /// </summary>
    /// <param name="action"></param>
    public void MouseListenAction(string action)
    {
        var sub = action.Substring(9);

        if (sub.Contains("New."))
        {
            _newGameWindow.MouseListen(sub);
        }
        else if (sub.Contains("Tutorial"))
        {
            _newGameWindow.MouseListen(sub);
        }
        else if (sub.Contains("Save."))
        {
            SaveLoadGameWindow.MouseListen(sub);
        }
        else if (sub == "Continue")
        {
            ContinueGameBtn();
        }
        else if (sub == "Resume")
        {
            Program.InputMain.EscapeKey();
        }
        else if (sub == "NewGame")
        {
            RedifineWindows();

            HideMainMakeWindActive(_newGameWindow);
        }
        else if (sub == "Exit")
        {
            if (!wasOptionalFeedbackShown)
            {
                Dialog.InputFormDialog(H.OptionalFeedback);
                wasOptionalFeedbackShown = true;
                return;
            }

            Application.Quit();
        }
        else if (sub == "SaveGame")
        {
            RedifineWindows();
            SaveLoadGameWindow.Show("Save");
        }
        else if (sub == "LoadGame")
        {
            RedifineWindows();
            SaveLoadGameWindow.Show("Load");
        }
        else if (sub.Contains("Options"))
        {
            RedifineWindows();
            _optionsWindow.Listen(sub);
        }
        else if (sub.Contains("Achieve"))
        {
            //this is a call from Main
            if (sub == "Achieve")
            {
                RedifineWindows();
                _achieveWindow.Show("");
            }
            //the hit of the ok
            else
            {
                _achieveWindow.MouseListen(sub);
            }

            //Debug.Log("Achive");
        }
    }