Пример #1
0
        private bool SendingBugReport()
        {
            var data = new BugIssueData
            {
                Occurrence  = Occurence,
                Platform    = Platform,
                Email       = Email,
                Title       = Title,
                Description = Detail,
                ReproSteps  = ReproSteps
            };

            return(JiraAPI.CreateBugIssue(data, new [] { ZipFilePath }));
        }
Пример #2
0
        private bool GatheringAdditionalInfo()
        {
            var builder = new StringBuilder();

            if (TinyPackageUtility.IsTinyPackageEmbedded)
            {
                builder.AppendLine($"WARNING: The {UTinyConstants.ApplicationName} package is embedeed in the manifest file, you might need to be manually embed it.");
                builder.AppendLine();
            }

            builder.AppendLine($"{nameof(SystemInfo.operatingSystemFamily)} : {SystemInfo.operatingSystemFamily}");
            builder.AppendLine($"{nameof(SystemInfo.operatingSystem)}       : {SystemInfo.operatingSystem}");
            builder.AppendLine($"{nameof(SystemInfo.processorType)}         : {SystemInfo.processorType}");
            builder.AppendLine($"{nameof(SystemInfo.processorCount)}        : {SystemInfo.processorCount}");
            builder.AppendLine($"{nameof(SystemInfo.processorFrequency)}    : {SystemInfo.processorFrequency}");
            builder.AppendLine($"{nameof(SystemInfo.graphicsDeviceType)}    : {SystemInfo.graphicsDeviceType}");


            var filename = "Assets/additional-info.txt";

            File.WriteAllText(filename, builder.ToString(), Encoding.UTF8);
            AssetDatabase.ImportAsset(filename, ImportAssetOptions.ImportRecursive | ImportAssetOptions.ForceSynchronousImport);

            File.Move(filename, $"{BugProjectPath}/{filename}");
            File.Move($"{filename}.meta", $"{BugProjectPath}/{filename}.meta");

            // Pack the issue-info, in case something goes wrong.
            var issueDataFile   = "Assets/bug-issue-info.txt";
            var issueDataString = new BugIssueData
            {
                Occurrence  = Occurence,
                Platform    = Platform,
                Email       = Email,
                Title       = Title,
                Description = Detail,
                ReproSteps  = ReproSteps
            }.GetDataString().Replace("\\n", "\n");

            File.WriteAllText(issueDataFile, issueDataString, Encoding.UTF8);
            AssetDatabase.ImportAsset(issueDataFile, ImportAssetOptions.ForceSynchronousImport);

            File.Move(issueDataFile, $"{BugProjectPath}/{issueDataFile}");
            File.Move($"{issueDataFile}.meta", $"{BugProjectPath}/{issueDataFile}.meta");
            return(true);
        }