This commit is contained in:
2023-09-14 14:20:26 +08:00
parent 97674a4b16
commit 39014e1de3
8 changed files with 45 additions and 7 deletions

View File

@@ -230,8 +230,9 @@ namespace AnyThink.Scripts.Editor
{
Directory.CreateDirectory(resXmlPath);
}
saveFile("Assets/AnyThinkPlugin/Script/Editor/anythink_network_security_config.xml", resXmlPath);
// var fromScriptableObject = MonoScript.FromScriptableObject(this);
var xmlPath = GetScriptsPath("ATPostProcessBuildAndroid");
saveFile($"{xmlPath}/anythink_network_security_config.xml", resXmlPath);
}
public static void saveFile(string filePathName , string toFilesPath)
@@ -241,6 +242,19 @@ namespace AnyThink.Scripts.Editor
file.CopyTo(toFilesPath + "/" + newFileName, true);
}
public static string GetScriptsPath (string scriptName)
{
string[] path = UnityEditor.AssetDatabase.FindAssets(scriptName);
if(path.Length>1)
{
// Debug.LogError("有同名文件"+_scriptName+"获取路径失败");
return null;
}
//将字符串中得脚本名字和后缀统统去除掉
string _path = AssetDatabase.GUIDToAssetPath(path[0]).Replace((@"/" +scriptName +".cs"),"");
return _path;
}
private static void addNetworkSecurityConfigInApplication(string path, bool isChina)
{
#if UNITY_2019_3_OR_NEWER