feat(integration): 添加 AppLovin SDK 集成管理功能

- 实现 AppLovinIntegrationManagerUtils 版本比较工具类
- 添加 AppLovinPackageManager 处理 UPM 和 Assets 包管理
- 实现 AppLovinPluginMigrationHelper 插件迁移辅助功能
- 添加 AppLovinUpmManifest 管理 UPM 清单文件操作
- 支持 mediation adapter 的版本检测和安装管理
- 实现重复适配器检测和删除功能
This commit is contained in:
2026-01-20 19:01:21 +08:00
parent 4da1b3290e
commit 5b3dfd98c2
76 changed files with 3768 additions and 3668 deletions

View File

@@ -15,31 +15,31 @@ namespace AppLovinMax.Internal
{
public class MaxEventExecutor : MonoBehaviour
{
private static MaxEventExecutor instance;
private static List<MaxAction> adEventsQueue = new List<MaxAction>();
private static MaxEventExecutor _instance;
private static readonly List<MaxAction> AdEventsQueue = new List<MaxAction>();
private static volatile bool adEventsQueueEmpty = true;
private static volatile bool _adEventsQueueEmpty = true;
struct MaxAction
{
public Action action;
public string eventName;
public readonly Action ActionToExecute;
public readonly string EventName;
public MaxAction(Action actionToExecute, string nameOfEvent)
{
action = actionToExecute;
eventName = nameOfEvent;
ActionToExecute = actionToExecute;
EventName = nameOfEvent;
}
}
public static void InitializeIfNeeded()
{
if (instance != null) return;
if (_instance != null) return;
var executor = new GameObject("MaxEventExecutor");
executor.hideFlags = HideFlags.HideAndDontSave;
DontDestroyOnLoad(executor);
instance = executor.AddComponent<MaxEventExecutor>();
_instance = executor.AddComponent<MaxEventExecutor>();
}
#region Public API
@@ -50,17 +50,17 @@ namespace AppLovinMax.Internal
get
{
InitializeIfNeeded();
return instance;
return _instance;
}
}
#endif
public static void ExecuteOnMainThread(Action action, string eventName)
{
lock (adEventsQueue)
lock (AdEventsQueue)
{
adEventsQueue.Add(new MaxAction(action, eventName));
adEventsQueueEmpty = false;
AdEventsQueue.Add(new MaxAction(action, eventName));
_adEventsQueueEmpty = false;
}
}
@@ -73,28 +73,28 @@ namespace AppLovinMax.Internal
public void Update()
{
if (adEventsQueueEmpty) return;
if (_adEventsQueueEmpty) return;
var actionsToExecute = new List<MaxAction>();
lock (adEventsQueue)
lock (AdEventsQueue)
{
actionsToExecute.AddRange(adEventsQueue);
adEventsQueue.Clear();
adEventsQueueEmpty = true;
actionsToExecute.AddRange(AdEventsQueue);
AdEventsQueue.Clear();
_adEventsQueueEmpty = true;
}
foreach (var maxAction in actionsToExecute)
{
if (maxAction.action.Target != null)
if (maxAction.ActionToExecute.Target != null)
{
try
{
maxAction.action.Invoke();
maxAction.ActionToExecute.Invoke();
}
catch (Exception exception)
{
MaxSdkLogger.UserError("Caught exception in publisher event: " + maxAction.eventName + ", exception: " + exception);
Debug.LogException(exception);
MaxSdkLogger.UserError("Caught exception in publisher event: " + maxAction.EventName + ", exception: " + exception);
MaxSdkLogger.LogException(exception);
}
}
}
@@ -102,7 +102,7 @@ namespace AppLovinMax.Internal
public void Disable()
{
instance = null;
_instance = null;
}
}
}