CUA Adding a DLL

  • Views Views: 2,033
  • Last updated Last updated:
  • Adding DLL to load with the asset or environment

    • Create a new .NET C# Class Library solution. ** Make sure to target .NET Framework 3.5 ** Ensure that the DLL compiled will have the same base name as your assetbundle! (this can be changed in Visual Studio using the project properties -> "assembly name")
    • Add a reference to "UnityEngine.dll"
    • note that the DLL built will not be able to reference VaM-specific objects, like Atom if you want it to show up in the Unity Editor (which you do).
    • Create your MonoBehaviour derived scripts and compile.
    • Add the DLL to the Assets in Unity and attach your scripts wherever.
    • Export assetbundle as described above (do not include the DLL at this step)
    • Copy the .assetbundle and .dll files (which should have the same name, because of step 1, right?) to <Vam>/Custom/Assets ** They must both be in the same directory, with the same base name. ** e.g. sample.dll will only be loaded with sample.assetbundle if they're in the same directory

    The DLL should now load with the asset and your scripts should function as expected.
Back
Top Bottom