Android 上的 C#:Xamarin 还是 Unity?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15649376/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 17:28:28  来源:igfitidea点击:

C# on Android: Xamarin or Unity?

c#androidunity3dxamarin

提问by Storm

I am a student and am supposed to code an Android application, probably a game. I have the opportunity to choose my programming language. I find JAVA quite ok, but I somehow like C# more. However, since C# is not natively supported by Android, I am looking for a way of implementing it.

我是一名学生,应该编写一个 Android 应用程序,可能是一个游戏。我有机会选择我的编程语言。我觉得 JAVA 还不错,但我更喜欢 C#。但是,由于 Android 本身不支持 C#,我正在寻找一种实现它的方法。

I have found a lot of recommendations for Xamarin, but it is not free. I understand, that the developers should be paid for their work, but since I am a student and will not make any profit of the app, it seems to me unfair to pay anything. I have come across Unity, which is free, but there is very little user feedback, compared to Xamarin.

我找到了很多关于 Xamarin 的建议,但它不是免费的。我明白,开发人员应该为他们的工作支付报酬,但由于我是一名学生,不会从应用程序中获利,在我看来,支付任何费用都是不公平的。我遇到过 Unity,它是免费的,但与 Xamarin 相比,用户反馈很少。

So, I would like to ask you for your recommendations - is Unity good enough, or should I sacrifice some money and buy Xamarin? Or are there any other solutions?

所以,我想请教您的建议 - Unity 是否足够好,还是我应该牺牲一些钱购买 Xamarin?或者还有其他解决方案吗?

回答by Jesse Carter

Xamarin has a free starter package that can be seen right here on their android page

Xamarin 有一个免费的入门包,可以在他们的android 页面上看到

Scroll down to the bottom to see the download link and the different packages you can get. Should be just fine for a school project.

向下滚动到底部以查看下载链接和您可以获得的不同软件包。对于学校项目应该没问题。

回答by Julien

Xamarin now has a free plan, you should give it a try. Of course there are restrictions but it may be okay for your student project. I used earlier versions of monodroid and I really recommend it whether you are using osx or windows.

Xamarin 现在有一个免费计划,你应该试一试。当然有限制,但对于您的学生项目可能没问题。我使用了早期版本的 monodroid,无论您使用的是 osx 还是 windows,我都非常推荐它。

回答by Shryme

I never tried Xamarin, but I did try Unity in order to make a simple game that was cross-platform. Unity has a 1-month trial so I would recommend it if your project is shorter then 1 month.

我从未尝试过 Xamarin,但我确实尝试过 Unity,以便制作跨平台的简单游戏。Unity 有 1 个月的试用期,因此如果您的项目短于 1 个月,我会推荐它。

There are many frameworks for creating a 2D games. The one I used was Futile, but it's still in alpha so you might want to try another one.

有许多框架可用于创建 2D 游戏。我使用的是Futile,但它仍处于 alpha 阶段,因此您可能想尝试另一个。

Good luck!

祝你好运!

回答by Cheesebaron

If you are going to choose to use Xamarin.Android don't forget that Xamarin offers Student Licenses. These cost $99 at the moment.

如果您打算选择使用 Xamarin.Android,请不要忘记Xamarin 提供学生许可证。目前这些售价为 99 美元。

On another note you might also want to look into MonoGame, which is essentially what know as XNA. With either MonoGame or Unity you should be able to make some nice games.

另一方面,您可能还想研究MonoGame,它本质上就是所谓的 XNA。使用 MonoGame 或 Unity,您应该能够制作一些不错的游戏。

The "Size capped to 32k of IL code" is not actual IL code but what you have in your output folder in your project. If you are going to create a game with sprites and sounds and such, 32k is not going to reach very far unless you load these resources from the Net or similar.

“大小上限为 32k 的 IL 代码”不是实际的 IL 代码,而是您项目的输出文件夹中的内容。如果你要创建一个带有精灵和声音等的游戏,除非你从网络或类似的地方加载这些资源,否则 32k 不会达到很远。