Exemplo n.º 1
0
        public static void DelStreamingResource()
        {
            if (EditorUtility.DisplayDialog("警告", string.Format("即将删除 {0} 目录下所有文件,操作不可逆,是否继续?", Application.streamingAssetsPath), "立刻、马上", "我再想想"))
            {
                Action <BuildTarget> method = (buildTarget) =>
                {
                    string resRoot      = AppPaths.StreamingResDataRoot;
                    string platformRoot = GetSuffix(buildTarget);
                    FileOperater.DeleteFileDirection(resRoot.Append(platformRoot));
                    FileOperater.DeleteFileDirection(resRoot.Append(platformRoot.Append(",meta")));
                };

                method.Invoke(BuildTarget.Android);
                method.Invoke(BuildTarget.iOS);
                method.Invoke(BuildTarget.StandaloneOSX);
                method.Invoke(BuildTarget.StandaloneWindows);
                method.Invoke(BuildTarget.StandaloneWindows64);

                FileOperater.DeleteFileDirection(AppPaths.StreamingResDataRoot);
                FileOperater.DeleteFileDirection(AppPaths.StreamingResDataRoot.Append(",meta"));

                AssetDatabase.Refresh();//刷新
            }
            else
            {
            }
        }
Exemplo n.º 2
0
 public static void DelPersistentResource()
 {
     if (EditorUtility.DisplayDialog("警告", string.Format("即将删除 {0} 目录下的资源文件,操作不可逆,是否继续?", Application.persistentDataPath), "立刻、马上", "我再想想"))
     {
         FileOperater.DeleteFileDirection(AppPaths.PersistentResDataRoot);
         AssetDatabase.Refresh();//刷新
     }
     else
     {
     }
 }