Unity 6.3
0 онлайн 67 гостей 3 в системе
Вход

CrashReporting.crashReportFolder

Declaration

public static string crashReportFolder;

Описание

Содержит путь к папке отчетов о сбоях на Windows.

Отчеты о сбоях хранятся в следующем расположении:

%TMP%\CompanyName\ProductName\Crashes

Отчетам о сбоях назначается уникальный путь при запуске, что позволяет заранее определить, где будет храниться отчет о сбоях в случае его возникновения.

Дополнительные ресурсы: PlayerSettings.companyName, PlayerSettings.productName.

// Required namespaces
using System.IO;                // For working with file system operations, such as directories and files.

using UnityEngine;

public class CrashReportExample : MonoBehaviour { void Start() { // Get the folder path where crash reports are stored string crashReportPath = UnityEngine.Windows.CrashReporting.crashReportFolder;

// Log the path to the console Debug.Log("Crash reports are stored in: " + crashReportPath);

// Check if the folder exists, and if it does, list crash reports if (Directory.Exists(crashReportPath)) { string[] crashReports = Directory.GetFiles(crashReportPath); foreach (string report in crashReports) { Debug.Log("Found crash report: " + report); } } else { Debug.Log("Crash report folder does not exist."); } } }