84 lines
2.5 KiB
C#
84 lines
2.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using UnityEngine;
|
|
|
|
namespace GeneralTools
|
|
{
|
|
public class DevicePath : MonoBehaviour
|
|
{
|
|
private static string streamingAssetsPath;
|
|
private static string persistentDataPath;
|
|
private static string currentDirectory;
|
|
private static string certificateProgramPath;
|
|
private static string certificateSystemPath;
|
|
public static string StreamingAssetsPath
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(streamingAssetsPath))
|
|
{
|
|
streamingAssetsPath = Application.streamingAssetsPath;
|
|
}
|
|
return streamingAssetsPath;
|
|
}
|
|
}
|
|
public static string PersistentDataPath
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(persistentDataPath))
|
|
{
|
|
persistentDataPath = Application.persistentDataPath;
|
|
}
|
|
return persistentDataPath;
|
|
}
|
|
}
|
|
public static string CurrentDirectory
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(currentDirectory))
|
|
{
|
|
#if UNITY_STANDALONE_WIN
|
|
currentDirectory = Directory.GetCurrentDirectory();
|
|
#else
|
|
currentDirectory = Application.persistentDataPath;
|
|
#endif
|
|
}
|
|
return currentDirectory;
|
|
}
|
|
}
|
|
public static string CertificateProgramPath
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(certificateProgramPath))
|
|
{
|
|
#if UNITY_STANDALONE_WIN
|
|
certificateProgramPath = Application.streamingAssetsPath + "/Certificate.ctf";
|
|
#else
|
|
certificateProgramPath = Application.streamingAssetsPath + "/Certificate.ctf";
|
|
#endif
|
|
}
|
|
return certificateProgramPath;
|
|
}
|
|
}
|
|
public static string CertificateSystemPath
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(certificateSystemPath))
|
|
{
|
|
#if UNITY_STANDALONE_WIN
|
|
certificateSystemPath = Application.persistentDataPath + "/Certificate.ctf";
|
|
#else
|
|
certificateSystemPath = Application.persistentDataPath + "/Certificate.ctf";
|
|
#endif
|
|
}
|
|
return certificateSystemPath;
|
|
}
|
|
}
|
|
}
|
|
} |