コード例 #1
0
        // MARK: - SaveDialogDelegate

        public void DidConfirmSave(SaveDialog dialog, string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                dialog.ShowErrorMessage("Please enter a name for your creature!");
                return;
            }

            try {
                editor.SaveCurrentDesign(name);
            } catch (IllegalFilenameException e) {
                dialog.ShowErrorMessage(string.Format("The creature name cannot contain: {0}",
                                                      new string(FileUtil.INVALID_FILENAME_CHARACTERS)));
                Debug.LogError(e.Message);
                return;
            }

            dialog.Close();
        }