using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;

/// <summary>
/// unity 路径扩展
/// </summary>
public class UnityAppPathEx
{
	/*
	/// <summary>
	/// 离线目录路径
	/// 程序启动时赋值
	/// </summary>
	private static string _offlinePath;

	/// <summary>
	/// 离线目录路径
	/// </summary>
	public static string offlinePath{ get { return _offlinePath; } }

	/// <summary>
	/// 程序启动时调用
	/// 检查文件夹
	/// </summary>
	public static void CheckFolder ()
	{
		_offlinePath = Path.Combine(Application.persistentDataPath, "offline");

		if (!Directory.Exists(_offlinePath))
		{
			Directory.CreateDirectory(_offlinePath);

			if (Application.platform == RuntimePlatform.IPhonePlayer)
			{
				#if UNITY_IOS
				// iOS需要设置为不备份
				UnityEngine.iOS.Device.SetNoBackupFlag(_offlinePath);
				#endif
			}
		}
	}
	*/

	public static string persistentDataPath
	{
		get { return Application.persistentDataPath; }
	}

	/// <summary>
	/// 程序启动时调用 将iOS的整个文稿目录设置为不备份
	/// </summary>
	public static void SetiOSDocumentsOffline ()
	{
		#if UNITY_IOS
		// iOS需要设置为不备份
		// TODO 不确定是否可是设置整个文稿目录
		UnityEngine.iOS.Device.SetNoBackupFlag(Application.persistentDataPath);
		#endif
	}
}
