文档

为 Unity 构构建自定义适配器

通过创建包含 Android 和 iOS 集成的 XML 文件为 Unity 开发自定义适配器,允许发行商将其添加到 Unity 项目中。
阅读时间2 分钟最后更新于 1 个月前

由于许多 LevelPlay 发行商正在使用 Unity 引擎来开发游戏,因此我们建议您为 Unity 创建专用接口。我们的最佳做法是使用 XML 文件。或者,如果发布者使用 Unity 手动集成,他们可以直接将原生工件添加到 Unity 项目中。 
按照以下说明为您的发布者提供 Unity 适配器: 
  1. 为 Android 创建自定义适配器。 
  2. 为 iOS 创建自定义适配器。
  3. 创建包含 Android 和 iOS 集成的 XML 文件,如下所述。

创建自定义适配器 XML

XML 文件将换行 Android 和 iOS 自定义适配器。务必将 XML 文件保存为:
IS<your\_network\_name>CustomAdapterDependencies.xml
发布者应将自定义适配器 XML 文件添加到 Unity 项目中的任何编辑器库中。您可以在此处了解有关 Unity 集成过程的更多信息。

示例

<dependencies> <androidPackages> <androidPackage spec=your-SDK-gradle> <repositories> <repository>your-network-repository-url</repository> </repositories> </androidPackage> </androidPackages> <androidPackages> <androidPackage spec=Your-Adapter-gradle> <repositories> <repository>Your-adapter-repository-url</repository> </repositories> </androidPackage> </androidPackages> <iosPods> <iosPod name=adapter_name version=your-pod-version> <sources> <source>https://github.com/CocoaPods/Specs</source> </sources> </iosPod> </iosPods></dependencies>