Unity3D和Android Studio集成 [英] Unity3D and Android Studio Integration

查看:1305
本文介绍了Unity3D和Android Studio集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道使用Unity Studio集成的机器人? (我会解释)
我在统一的测试创建了一个简单的场景(版本4.3.x在OSX Maverics)。有一个3D对象而已。
我这样做,以x code这里使用的解释#1,我在这里发布我的完整code(<一href="http://stackoverflow.com/questions/23034712/touch-a-uibutton-and-show-unity-on-uiview-or-uiviewcontroller/24574285#24574285">Touch上的UIView或UIViewController的)一个UIButton,并显示团结,以显示它真的很简单。
但现在,我需要做同样的在Android工作室(我安装,我可以将项目从Unity出口到Android)
我唯一​​知道的是,AndroidManifest.xml中的文件是RES /设计/(东西)的.xml文件是第(读)和(显示)在屏幕上的布局,当你在创建项目Android的工作室。

Anyone know integrate Android with Unity Studio? (i will explain)
I created a simple scene in Unity (4.3.x on OSX Maverics) for testing. Has a 3D object and nothing else.
I do this in XCode using the Stackoverflow explanations here and i post my complete code here ( Touch a UIButton and show Unity on UIView or UIViewController ) to show it's really simple.
But now, I need to do the same on Android Studio (which I installed and I can export the project from Unity to Android)
The only thing I know is that the AndroidManifest.xml and the file is in "res/layout/(something).xml" files that are the first (read) and (displays) the layout on the screen when you create a project on Android Studio.

当您打开了统一生成的项目,你唯一XML是AndroidManifest。
所以,我迷路了。由于第三部分网站上的文档(的http://www.rbcafe.com/Softwares/Unity/Documentation/Manual/android-GettingStarted.html)只提到了团结Eclipse和没有项目存在的Java文件,让我更失落。

When you open the generated project from Unity, the only XML you have is AndroidManifest.
So I'm lost. Since the document of third part site (http://www.rbcafe.com/Softwares/Unity/Documentation/Manual/android-GettingStarted.html) only mentions the Unity Eclipse and a JAVA files that do not exist in the project, makes me more lost.

在Objective-C,创建您somethingDelegate.mm和.h和插入一行code,并准备。在Android中似乎并没有那么简单,因为这正式文件( http://docs.unity3d.com /Manual/PluginsForAndroid.html )说。

In Objective-C, you create your somethingDelegate.mm and .h and inserts "a line of code" and ready. In Android does not seem to be as simple as this official document (http://docs.unity3d.com/Manual/PluginsForAndroid.html ) says.

有人已经这样做在Android Studio和能帮助我吗?

Someone already did this in the Android Studio and could help me?

在此先感谢。

** 编辑以赏金: **

需要创建3个观点:
1 - 主视图,2个按钮;
2 - 一键进入第二视图;
3 - 其他按钮,进入Unity模式;

必须有一种简单的方法来做到这一点在Android作为工作室制作上面的链接。

** Edited for bounty: **

Need to create 3 views:
1 - Main View with 2 buttons;
2 - One button go to a second View;
3 - Other button go to Unity View;

There must be a simple way to do this on Android as a studio made ​​the link above.

推荐答案

建立一个Android项目是非常简单的。您链接的文件已经过时,你不需要动任何文件都没有。

Setting up an Android project is really simple. The document you linked is outdated and you don't need to move any files at all.

统一

  1. 转到文件 - &GT;构建设置 - &GT;安卓,点击交换平台
  2. 启用谷歌Android项目
  3. 点击导出,并选择您想要的Andr​​oid项目为
  1. Goto File -> Build Settings -> Android and click Switch Platform
  2. Enable Google Android Project
  3. Click Export and choose where you want the Android project to be

Android的工作室

  1. 在进口或打开你刚才使用Unity创建的项目
  2. 完成:)

如果你想显示Unity引擎一个子活动里面,我建议你看看<一href="http://stackoverflow.com/questions/23467994/errors-managing-the-unityplayer-lifecycle-in-a-native-android-application/23541969#23541969">this回答。

If you want to display the Unity engine inside a subactivity, I suggest you take a look at this answer.

如果你完全不熟悉Android的发展,你应该从一个简单的Hello World应用程序不加统一的组合复杂的事情。只要遵循一些href="http://developer.android.com/training/index.html" rel="nofollow">官方Android导游中的

If you're completely unfamiliar with Android development, you should start with a simple "Hello World" app without complicating things by adding Unity to the mix. Just follow some of the official Android guides.

这篇关于Unity3D和Android Studio集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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