Files
tysdk-intergration/sdk-intergration/Assets/MaxSdk/Scripts/MaxEventSystemChecker.cs
tech 5b3dfd98c2 feat(integration): 添加 AppLovin SDK 集成管理功能
- 实现 AppLovinIntegrationManagerUtils 版本比较工具类
- 添加 AppLovinPackageManager 处理 UPM 和 Assets 包管理
- 实现 AppLovinPluginMigrationHelper 插件迁移辅助功能
- 添加 AppLovinUpmManifest 管理 UPM 清单文件操作
- 支持 mediation adapter 的版本检测和安装管理
- 实现重复适配器检测和删除功能
2026-01-20 19:02:06 +08:00

38 lines
991 B
C#

//
// EventSystemChecker.cs
// AppLovin MAX Unity Plugin
//
// Created by Jonathan Liu on 10/23/2022.
// Copyright © 2022 AppLovin. All rights reserved.
//
#if UNITY_EDITOR
using UnityEngine;
using UnityEngine.EventSystems;
namespace AppLovinMax.Scripts
{
/// <summary>
/// A script to check and enable event system as needed for the AppLovin MAX ad prefabs.
/// </summary>
[RequireComponent(typeof(EventSystem))]
public class MaxEventSystemChecker : MonoBehaviour
{
private void Awake()
{
// Enable the EventSystem if there is no other EventSystem in the scene
var eventSystem = GetComponent<EventSystem>();
var currentSystem = EventSystem.current;
if (currentSystem == null || currentSystem == eventSystem)
{
eventSystem.enabled = true;
}
else
{
eventSystem.enabled = false;
}
}
}
}
#endif