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

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

问题描述

有人知道将 Android 与 Unity Studio 集成吗?(我会解释)
我在 Unity(OSX Maverics 上的 4.3.x)中创建了一个简单的场景进行测试.有一个 3D 对象,没有别的.
我在这里使用 Stackoverflow 解释在 XCode 中执行此操作,并在此处发布我的完整代码( 触摸 UIButton 并在 UIView 或 UIViewController 上显示 Unity ) 以表明它非常简单.
但是现在,我需要在 Android Studio 上做同样的事情(我安装了它,我可以将项目从 Unity 导出到 Android)
我唯一知道的是 AndroidManifest.xml 和文件位于res/layout/(something).xml"文件中,当您在安卓工作室.

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.

当您从 Unity 打开生成的项目时,您拥有的唯一 XML 是 AndroidManifest.
所以我迷路了.由于第三方站点的文档(http://www.rbcafe.com/Softwares/Unity/Documentation/Manual/android-GettingStarted.html)只提到了Unity 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 并插入一行代码"并准备就绪.在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. 转到<代码>文件->构建设置 ->Android 然后点击切换平台
  2. 启用 Google Android 项目
  3. 点击Export并选择你想要的Android项目
  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 Studio

  1. 导入或打开您刚刚使用 Unity 创建的项目
  2. 完成:)

如果你想在一个subactivity里面展示Unity引擎,我建议你看看这个答案.

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

如果您完全不熟悉 Android 开发,您应该从一个简单的Hello World"应用开始,不要通过将 Unity 添加到组合中来使事情复杂化.只需遵循一些官方 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天全站免登陆