Table of Contents

Add Custom Code to a VIROO Scene

To add code to your scene, it has to be inside an Assembly Definition File (.asmdef). And this has to be added to the Scene Publisher window to be compiled together with your scene.

Add your code inside an Assembly

When you create your own code for your VIROO Scene you have to put it in an Assembly.

  1. Create a new folder (or use an existing one) to organize your code.
  2. In it, right click and select: Create -> Assembly Definition.

custom-code-assembly.png

  1. Selecting the newly created Assembly, in the inspector at the bottom click on Apply.

Add your code to Scene Publisher window

Now in the Scene Publisher window, in the Optional section, you can add different Assemblies that you have created.

  1. Go to Window -> Viroo -> Scene Publisher.
  2. In the Optional section, expand Assembly Definitions and add your Assembly Definition File (.asmdef), created in previous steps.

custom-code-publisher-window.png

Add VIROO dependencies to your Assembly

If you get any errors, it is possible that it is for using code referenced from VIROO packages (for example, to make your own interactions). In that case, it is necessary to reference the assemblies of VIROO inside your assembly.

To reference them, in the Assembly inspector, you can add the following two in Assembly Definition References:

  • Viroo.Unity
  • Viroo.Interactions.Unity

custom-code-viroo-dependencies.png