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.
- Create a new folder (or use an existing one) to organize your code.
- In it, right click and select:
Create -> Assembly Definition
.
- 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.
- Go to
Window -> Viroo -> Scene Publisher
. - In the
Optional
section, expandAssembly Definitions
and add yourAssembly Definition File
(.asmdef), created in previous steps.
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