Пример #1
0
 void OnGUI()
 {
     if (confirmDialog.IsConfirming())
     {
         string message = "\"" + saveName + "\" already exists. Do you widh to continue?";
         confirmDialog.Show(message, mySkin);
     }
     else if (confirmDialog.MadeChoice())
     {
         if (confirmDialog.ClickedYes())
         {
             SaveGame();
         }
         confirmDialog.EndConfirmation();
     }
     else
     {
         if (SelectionList.MouseDoubleClick())
         {
             PlayClick();
             saveName = SelectionList.GetCurrentEntry();
             StartSave();
         }
         GUI.skin = mySkin;
         DrawMenu();
         // Handle enter being hit when typing in the text field
         if (Event.current.keyCode == KeyCode.Return)
         {
             StartSave();
         }
         // If typing and cancel is hit, nothing happens..
         // doesn't appear to be a quick fix either..
     }
 }
Пример #2
0
    void OnGUI()
    {
        if (confirmDialog.IsConfirming())
        {
            string message = "\"" + saveName + "\" already exists. Do you wish to continue?";
            confirmDialog.Show(message, mySkin);
        }
        else if (confirmDialog.MadeChoice())
        {
            if (confirmDialog.ClickedYes())
            {
                SaveGame();
            }
            confirmDialog.EndConfirmation();
        }
        else
        {
            if (SelectionList.MouseDoubleClick())
            {
                PlayClick();
                saveName = SelectionList.GetCurrentEntry();
                StartSave();
            }
        }
        GUI.skin = mySkin;
        DrawMenu();

        if (Event.current.keyCode == KeyCode.Return)
        {
            StartSave();
        }
    }