如何在Unity中使用Gradle [英] How to use Gradle in Unity

查看:515
本文介绍了如何在Unity中使用Gradle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我想将Firebase添加到我的Android游戏中,因此我想包含Google Auth.但是我有以下问题.我需要在build.gradle文件中添加一些代码,但是在Unity项目中找不到它.

Since I want to add Firebase to my Android Game I want to include Google Auth. But I have the following Problem. I need to add some Code to the build.gradle File but I cant find it in my Unity Project.

这是我从Firebase找到的手册: https://firebase. google.com/docs/auth/android/google-signin

Here is the manual I found from Firebase : https://firebase.google.com/docs/auth/android/google-signin

我在所有云端硬盘上搜索了build.gradle,但什么也没找到. 您能告诉我在哪里找到它,或者必须执行什么操作才能从链接中实现该代码吗?

I searched on all my Drives for build.gradle but found nothing. Can you tell me where I find it or what do I have to do to implement the Code from the Link?

推荐答案

要在Unity中使用Gradle.

To use Gradle in Unity.

1 .转到<UnityInstallationDirecory>\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates,然后将mainTemplate.gradle文件复制到您的<ProjectName>Assets\Plugins\Android文件夹中.

1.Go to <UnityInstallationDirecory>\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates, then copy mainTemplate.gradle file to your <ProjectName>Assets\Plugins\Android folder.

2 .然后您可以将mainTemplate.gradle修改为所需的值.现在,要确保构建使用gradle文件,请将 Build System 更改为"Gradle(New)" .

2.You can then modify mainTemplate.gradle to be whatever you want it to be. Now, to make sure the build uses the gradle file, change the Build System to "Gradle (New)".

这篇关于如何在Unity中使用Gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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