简体   繁体   English

连续将Unity项目导出到Android Studio / XCode

[英]Exporting Unity project to Android Studio / XCode continuously

I'm developing a game on Unity for Android & iOS. 我正在Android和iOS的Unity上开发游戏。

When building the project, on both platforms, Unity builds a project you can import into Android Studio / XCode, then add the platform-specific code on Java / Swift / Obj-C. 在两个平台上构建项目时,Unity都会构建一个项目,您可以将其导入Android Studio / XCode,然后在Java / Swift / Obj-C上添加特定于平台的代码。

This is great in its own, but since the game is still under heavy development, it'll ease things greatly if I could shorten the build pipeline. 这本身就是很棒的,但是由于游戏仍在大量开发中,如果我可以缩短构建流程,它将大大简化工作。

Currently it's: 目前是:

  1. Build in Unity and get a exported project folder 在Unity中构建并获取导出的项目文件夹
  2. Open Android Studio / XCode 打开Android Studio / XCode
  3. Import the Unity project 导入Unity项目
  4. Add the platform specific files (I have lots of those since I use external SDKs) 添加特定于平台的文件(由于使用了外部SDK,所以有很多文件)
  5. Build & Debug 编译和调试

So my questions are: 所以我的问题是:

  1. Is there a way for Unity to update an existing Android Studio / XCode project? Unity是否可以更新现有的Android Studio / XCode项目?
  2. Is there a way to add the platform-specific files to Unity so it'll create the project structure on its own? 有没有一种方法可以将特定于平台的文件添加到Unity,以便它自己创建项目结构? (and even build & install the app?) (甚至构建并安装该应用程序?)

I'm working through this myself, with PC-based Android development (build via Android Studio), and Mac-based iOS development (build via XCode). 我正在自己进行基于PC的Android开发(通过Android Studio构建)和基于Mac的iOS开发(通过XCode构建)。 The approach I currently plan to use is to place the platform-native code in library modules, the Unity build-files in their own dedicated module, and have a platform-native wrapper to bind it all together. 我目前计划使用的方法是将平台本机代码放置在库模块中,将Unity构建文件放置在它们自己的专用模块中,并使用一个平台本机包装器将它们绑定在一起。

This approach also promotes separation of scope and versioning - you can quickly iterate through changes to either the native or Unity codebase, keeping the other part version-locked. 这种方法还促进了范围和版本控制的分离-您可以通过对本机代码库或Unity代码库的更改进行快速迭代,从而使另一部分保持版本锁定。 It also prevents Unity version-upgrades from mucking up your native codebase, as Unity builds for Android/iOS can change internal structure across versions. 它还可以防止Unity版本升级破坏您的本机代码库,因为针对Android / iOS的Unity构建可以更改版本之间的内部结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM