Is it practical to start a Unity game from an Android app and revert back from Unity to the app?

一曲冷凌霜 提交于 2020-01-13 10:56:10

问题


I'm having an android project build in android native code[Java]. and one another game project build in unity. I wanna launch the game project from within android app and on exit or completion get back to the android app.

The unity? game project contains following file hierarchy, I don't have any taste of this unity thing. Well i'm not even sure, is this the unity based project ?

Screenshot of game project files http://img821.imageshack.us/img821/321/4ird.png


回答1:


You should be able to have two activities in your app, one using your java code and another with the Unity game. Android is already pretty good at switching between activities.

Check out this: http://developer.android.com/training/basics/firstapp/starting-activity.html

You'll probably need to add your Java project as a plugin in Unity and override the AndroidManifest.xml in the Unity project to load the Java activity. Check out this documentation on extending android projects in Unity: http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html



来源:https://stackoverflow.com/questions/18399254/is-it-practical-to-start-a-unity-game-from-an-android-app-and-revert-back-from-u

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!