How to develop shared code for a Unity project?

妖精的绣舞 提交于 2019-12-24 17:52:51

问题


If I wrote a game in LibGdx and wanted a shared (reusable in the future) part, then I'd write a library in Java and install it to a local Maven / Gradle repository. End of story.

What if I'm using Unity?

  • Do I have to code in C#?
  • Do I have to use VisualStudio / Unity IDE / ... to develop the code?
  • How to make it shared among my projects?

回答1:


Unity provides a way to export unitypackages that can help to distribute assets between projects and an assets server that works almost equals to maven repository (you can see unity store to have an idea).

You will need Unity IDE to pack as unitypacks but it is not restricted to language or external code editors (You code where you find more confortable and using C# or US doesn't matter but to inport/export packages you will need UnityEditor).

This packages are not restricted for code assets it packs any kind of asset supported by unity (also DLLs and plugins).

ps: just to remember that unity doesn't provide a java language support is just C# and UnityScript today, this last one frequently associated to JavaScript or mistaken for Java.




回答2:


This document from Unity might help:
http://docs.unity3d.com/Manual/Plugins.html
http://docs.unity3d.com/Manual/UsingDLL.html
http://docs.unity3d.com/Manual/NativePlugins.html



来源:https://stackoverflow.com/questions/31596022/how-to-develop-shared-code-for-a-unity-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!