16

Unity导出Android Studio工程时如何避免工程覆盖

 3 years ago
source link: https://xmanyou.com/unity-export-android-studio-without-overriding/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
28 February 2020 / 开发笔记

Unity导出Android Studio工程时如何避免工程覆盖

有时候,我们需要用Unity导出Android Studio工程,然后进行定制化,比如添加一些插件的调用代码,最后再导出Apk。

但是,如果多次导出时,会发现,Unity把修改过的工程给覆盖了!

这可怎么办?

Unity不会删除我们自己添加的文件。

Unity只会覆盖自动生成的代码和资源文件,包含Gradle。

如果我们修改了Unity生成的文件,比如build.gradle,比如UnityPlayerActivity.java等,那么可以删除这些文件中以下注释,来防止Unity覆盖该文件:

GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

Unity_android_studio_export_override_01

搜索以下,可以发现所有Unity生成的包含这个注释的文件有

  • manifest
  • gradle

Unity_android_studio_export_override_02

https://forum.unity.com/threads/make-changes-to-android-studio-project-exported-from-unity.576154/

阿斌

Read more posts by this author.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK