UnityLink`
UnityLink`

CreateUnityLibrary

CreateUnityLibrary [func,"libname"]

creates a shared library libname from a compiled version of func suitable for use in Unity.

CreateUnityLibrary [namefunc,"libname"]

exports func with the specified name.

CreateUnityLibrary [{func,name1func1,},"libname"]

exports compiled versions of func, func1,.

Details

  • CreateUnityLibrary generates a library suitable for use on the type of computer on which it is run.
  • CreateUnityLibrary creates a library in the directory specified by the current value of $UnityAssetsDirectory.
  • The file created can subsequently be loaded in Unity scripts and applications.

Examples

Basic Examples  (2)

Load the Unity Link:

In[1]:=
Click for copyable input

Open a new Unity project:

In[2]:=
Click for copyable input

Create a random number generator library using RandomReal:

In[1]:=
Click for copyable input

C# script for loading the library and calling the random generator:

In[2]:=
Click for copyable input

Play:

In[3]:=
Click for copyable input

Close Unity:

In[4]:=
Click for copyable input