44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
namespace Guru.Editor
|
|
{
|
|
using System.IO;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
public class AndroidResMod
|
|
{
|
|
private static readonly string ResName = "GuruSDKRes";
|
|
private static string ResFullPath = Path.Combine(Application.dataPath, $"Plugins/Android/{ResName}.androidlib");
|
|
|
|
/// <summary>
|
|
/// 应用补丁
|
|
/// </summary>
|
|
public static void Apply()
|
|
{
|
|
DeployAndroidRes();
|
|
}
|
|
|
|
|
|
private static void DeployAndroidRes()
|
|
{
|
|
var spath = GuruEditorHelper.GetFilePath($"{nameof(AndroidResMod)} t:Script");
|
|
if (!string.IsNullOrEmpty(spath))
|
|
{
|
|
var from = Path.GetFullPath($"{spath}/../../Files/sdk_res");
|
|
if (Directory.Exists(from))
|
|
{
|
|
var to = ResFullPath;
|
|
if (Directory.Exists(to))
|
|
{
|
|
FileUtil.DeleteFileOrDirectory(ResFullPath);
|
|
}
|
|
|
|
FileUtil.CopyFileOrDirectory(from, to);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
} |