更新sdk

This commit is contained in:
2026-03-18 15:52:02 +08:00
parent e3781c731d
commit 8d4617f851
120 changed files with 972 additions and 375 deletions

View File

@@ -16,7 +16,7 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
public class ATConfig
{
public static string PLUGIN_VERSION = "2.1.5";
public static string PLUGIN_VERSION = "2.1.7";
public static bool isDebug = false;
public static int PLUGIN_TYPE = 1;
@@ -46,36 +46,34 @@ public static bool isDebug = false;
//network json文件名
public static string network_data_file_name = "network_data.json";
//插件设置的数据
public static string plugin_setting_data_path = $"{RootPath}/Resources/json/" + PLUGIN_VERSION;
public static string plugin_setting_data_file_name = "plugin_setting_data.json";
public static string plugin_setting_data_path = $"{RootPath}/Resources/json/" + PLUGIN_VERSION;
private static string plugin_setting_data_file_name = "plugin_setting_data.json";
private static string _rootPath;
public static string RootPath
{
get
{
if (string.IsNullOrEmpty(_rootPath))
{
var scriptsPath = GetScriptsPath ("ATConfig");
_rootPath = $"{scriptsPath}/../../../";
var scriptsPath = GetScriptsPath("ATConfig");
_rootPath = string.IsNullOrEmpty(scriptsPath) ? "Assets/AnyThinkPlugin" : $"{scriptsPath}/../../../";
}
return _rootPath;
}
}
public static string GetScriptsPath (string scriptName)
public static string GetScriptsPath(string scriptName)
{
string[] path = UnityEditor.AssetDatabase.FindAssets(scriptName);
if(path.Length >1)
var guids = AssetDatabase.FindAssets($"{scriptName} t:Script");
if (guids.Length != 1)
{
// Debug.LogError("有同名文件"+_scriptName+"获取路径失败");
return null;
}
//将字符串中得脚本名字和后缀统统去除掉
string _path = AssetDatabase.GUIDToAssetPath(path[0]).Replace((@"/" +scriptName +".cs"),"");
return _path;
return AssetDatabase.GUIDToAssetPath(guids[0]).Replace("/" + scriptName + ".cs", "");
}
//保存插件设置的数据保存时机安装core包、选择国家、切换SDK、androidX设置发生变化时
@@ -157,6 +155,23 @@ public static bool isDebug = false;
FileUtil.DeleteFileOrDirectory(path + ".meta");
}
}
//针对mintegral改名字为gtm后旧版升级到新版旧版的mintegral目录需要删除
var displayName = network.DisplayName;
var name = network.Name;
ATLog.log("removeInstalledNetwork() >>> displayName: " + displayName + " name: " + name);
if (Equals(displayName, "Mintegral") && Equals(name, "Gtm"))
{
displayName = "mintegral";
var mtgPath = getNetworkInstallPath(displayName, os, network.Country);
if (Directory.Exists(mtgPath))
{
FileUtil.DeleteFileOrDirectory(mtgPath);
if (File.Exists(mtgPath + ".meta"))
{
FileUtil.DeleteFileOrDirectory(mtgPath + ".meta");
}
}
}
return true;
}
@@ -275,10 +290,22 @@ public static bool isDebug = false;
return country == CHINA_COUNTRY ? IOS_NETWORK_FILES_PARENT_PATH + networkName : NONCHINA_IOS_NETWORK_FILES_PARENT_PATH + networkName;
}
//根据network名字去获取安装路径
private static string getNetworkInstallPath(string networkName, int os, int country)
{
if (os == OS_ANDROID) {
return country == CHINA_COUNTRY ? CHINA_ANDROID_NETWORK_FILES_PARENT_PATH + networkName.ToLower() : NONCHINA_ANDROID_NETWORK_FILES_PARENT_PATH + networkName.ToLower();
} else {
return country == CHINA_COUNTRY ? IOS_NETWORK_FILES_PARENT_PATH + networkName : NONCHINA_IOS_NETWORK_FILES_PARENT_PATH + networkName;
}
}
public static int getSelectedCountry() {
public static int getSelectedCountry()
{
var pluginSettingData = getPluginSettingData();
if (pluginSettingData != null) {
if (pluginSettingData != null)
{
return pluginSettingData.curCountry;
}
return CHINA_COUNTRY;
@@ -387,7 +414,8 @@ public static bool isDebug = false;
if(PLUGIN_TYPE == 2) {
return new string[] { "Overseas" };
}
return new string[] { "ChinaMainland", "Overseas" };
// return new string[] { "ChinaMainland", "Overseas" };
return new string[] { "ChinaMainland" };
}
public static string getRegionIntegrateTip()
@@ -423,4 +451,4 @@ public static bool isDebug = false;
}
}
}
}