从Android应用程序启动Unity游戏并从Unity恢复到该应用程序是否可行? [英] Is it practical to start a Unity game from an Android app and revert back from Unity to the app?

查看:84
本文介绍了从Android应用程序启动Unity游戏并从Unity恢复到该应用程序是否可行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用android本机代码[Java]构建一个android项目.和另一个游戏项目统一建立.我想从android应用程序中启动游戏项目,并在退出或完成时返回到android应用程序.

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 ?

游戏项目文件的屏幕截图http://img821.imageshack.us/img821/321/4ird.png

推荐答案

您应该能够在应用程序中进行两项活动,一项活动使用Java代码,另一项使用Unity游戏. Android已经非常擅长在活动之间进行切换.

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.

查看以下内容: http://developer.android.com/training/basics/firstapp/starting-activity.html

您可能需要将Java项目添加为Unity中的插件,并覆盖Unity项目中的AndroidManifest.xml才能加载Java活动.查看有关在Unity中扩展android项目的文档: http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.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

这篇关于从Android应用程序启动Unity游戏并从Unity恢复到该应用程序是否可行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆