I am working on a research project and I want to know if I can use Julia for the game engine unity. If so, How would it access the libraries?
Thanks!
You can only use C# and/or UnityScript (a kind of javascript for Unity).
In the past another language; Boo was also an option, but the support was removed.
Source: Unity scripting languages and you
Related
I know that is possible export Unity projects to WebGL, but is there a way to use code from a ImpactJS project on Unity?
I checked the web for converter and found none, so unless I missed something, what you are trying to do is impossible.
There is always a way to convert. Sometimes it may require some manual fixing. Generally most languages are similar enough that you can automate many parts. The art assets are often re-usable, for example.
No. Unity converts it's own framework and system of gameobjects and c# code that you write into WebGL code.
However, if you have computing and business code that does not do much with the canvas/UI then that code can be copied over somewhat. For code that is purely computational or business logic, you can use any online tool to convert javascript into C# code with some success.
My guess is that if most of your code dealt with the canvas and UI and interaction, that none of that code will be able to be reused.
I'm developing a C# library that will be used either as a plugin in some Unity3d projects and also used in non-Unity3d projects.
I need to use some Unity3d classes (such as UnityEngine.Matrix4x4) and standardize some functions to use valid types agnostically to whether the project is an Unity project or not.
So, as the title says: what is the right way to include Unity3d libraries in a non-Unity3d library project? Should I just include reference to the local Unity3d binaries (like UnityEngine.dll) in my project? If so, which is the right folder to look for these binaries (they appear in some different folders in the unity installation folder)?
If you are not actually running the Unity Engine for rendering or handling input it may be the case of forcing a round peg into a square hole, both technically and legally.
The most elegant solution would likely be to write your library in C# using more agnostic libraries. For example the Matrix4x4 class you mentioned has an equivalent in System.Numerics. Alongside the library all thats needed is a light wrapper converting a System.Numerics.Matrix4x4 to a UnityEngine.Matrix4x4. Sometimes the Unity devs themselves do stuff like this, for example the Unity.Mathematics.float3 struct which works better in ECS land than a standard Vector3.
FYI if you're looking for how some particular system works, check out the C# Reference GitHub Repository, for example the Matrix4x4 struct. Just be aware that 'copying and pasting' Unity source code is not allowed.
I'm getting into Unity, and wondering if I can use F# instead of C#, simply because I prefer the syntax. I'm guessing not, since the environment it runs on is very different, but maybe there's something that will cross-compile code or something else I'm not thinking of.
I can't help but get the impression that the other answers were written by people who do not really know what they are talking about.
This is what you need to do to use F# in a Unity project:
Create an F# project that compiles into a dll. Have it build into the assets folder of a Unity project.
Add references to UnityEngine.dll and/or UnityEditor.dll. Change the reference properties so the dlls aren't copied to the build folder.
Of course you can't create new F# classes from within the Unity editor this way, but you can assign the ones you wrote in F#.
Currently you need to enable the (experimental) support for .NET-version 4.5. Alternatively you can download an older version of the FSharp.Core.dll that supports .NET 3.5. (see here).
I can't guarantee that you won't run into trouble because of compatibility issues with the FSharp.Core.dll, but that's just a guess since I haven't tested it myself.
I had success doing this sometime back by following this Github project: https://github.com/eriksvedang/FSharp-Unity, which I believe is roughly the same as Lars Kokemohr's answer above. I haven't tested it in more recent versions of Unity/Mono however.
Yes you can use F# as first class language as C# in unity.
Here is an article about it link
an excellent blog for One who want to use F# in unity
if you want to use F# as second class which I recommend.
let me show how to do it.
Usually what I do is to create Game Domain in F# in .net standard
2.0 library project build it.
Make unity API Compatibility level .net standard 2.0 then
Import library project dll in asset/plugins in Unity
Here is an explanation on how to do it automatically after each build : link
You will get this error, here is the solution
Having said that I recommend not to do any serious work in unity with F# because you won't be able to cross compile to other platforms.
Unity uses IL2cpp and it don't work with F#.
In simple words unity don't support F# and if you are having issues like bugs in Il2cpp unity will not fix it because they don't support F#
There is no easy way to do this but if you REALLY want to make it happen I believe you could use something like fs2cs:
https://github.com/hsharpsoftware/fs2cs
In theory you could write a script that calls fs2cs on all of your Unity C# files. Integrating this with Unity itself would be the more challenging part, but in theory you can trigger fs2cs transpilation on save of your file and Unity can use the transpiled C# file.
Only Boo, C#, and UnityScript are officially supported!
I am using unity3D for the first time to develop a game.I have written a code in c++ using Opencv and the code consist on many files.Now I want to apply the result computed by c++ code to a 3D character.
How i can use my c++ code in unity.Please help me.Remember I am using OpenCV Libraries in my c++ Code.
Thanks!!
You need to write a DLL file and use it within Unity. There is many examples on how to do so.
http://docs.unity3d.com/Manual/Plugins.html
If you have some money you can also purchase the Unity source code that is written in c++ though that seems a bit overkill.
did some googlefu...
C++ is not a scripting language, and can only be used with Unity in the form of plug-ins (in the Pro version). C# is closer in syntax to C++ than Javascript is.
http://answers.unity3d.com/questions/12809/can-i-use-c-as-a-scripting-lanques-for-unity.html
(couldn't find anything that contradicted that)
although these might be of interest:
https://gamedev.stackexchange.com/questions/82518/is-it-possible-to-use-c-with-unity-instead-of-c
http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/
I'd like to try out WebGL but do not like JavaScript that much. Are there any *-to-JavaScript compilers like GWT (Java to JavaScript) which you can recommend for WebGL development?
GwtGl allows the use of WebGL in a GWT project.
I've found gwt-g3d to be the best.
Examples worked the first time for me and it comes with lots of useful utilities e.g. common shader types, common matrix functions etc.
I also vote for GwtGL! It was very easy to write WebGL applications with this wrapper. I can use all benefits from Java and interact with other, state of the art, javascript libraries like gl-matrix to get matrix functions. I've written some posts how to use GwtGL based on the famous learningwebgl.com tutorials here http://gibberfish.net/learning-webgl-lesson-1-with-gwtgl/.