public static void ShowWindowWithScreenshot()
 {
     _showScreenShots = true;
     LoadWindow();
     VoxUtility.TakeScreenshot();
 }
    private void Submit()
    {
        if (_titleText == string.Empty)
        {
            if (EditorUtility.DisplayDialog("ERROR", "Report must have a title", "Understood"))
            {
                return;
            }
        }

        Report __report = new Report();

        __report.id          = _bugID.ToString();
        __report.title       = _titleText;
        __report.description = _descriptionText;
        __report.user        = _user;

        if (_listScreenShots.Count == 1 && _listScreenShots[0] == null)
        {
            __report.listScreenShots = null;
        }
        else
        {
            __report.listScreenShots = new List <string>(_listScreenShots.Count);
            for (int i = 0; i < _listScreenShots.Count; i++)
            {
                string __fileName = _listScreenShots[i].name;
                if (__fileName.Contains(".png") == false)
                {
                    __fileName += ".png";
                }
                __report.listScreenShots.Add(__fileName);
            }
        }

        Action __callbackWriteData = () =>
        {
            StreamWriter __fieldDataWriter = File.CreateText(Application.dataPath + "/VoxReports/" + __report.id + ".json");
            __fieldDataWriter.WriteLine(JsonUtility.ToJson(__report, true));
            __fieldDataWriter.Close();
            ResetWindow();
            if (_showScreenShots)
            {
                VoxUtility.TakeScreenshot();
            }

            if (_createAnotherReport == false)
            {
                AssetDatabase.Refresh();
                _window.Close();
            }
        };

        if (Directory.Exists(Application.dataPath + "/VoxReports"))
        {
            __callbackWriteData();
        }
        else
        {
            if (Directory.Exists(Application.dataPath + "/VoxReports") == false)
            {
                Directory.CreateDirectory(Application.dataPath + "/VoxReports");
            }

            __callbackWriteData();
        }
    }