This document is about: QUANTUM 3
SWITCH TO

Assembly Definitions

Introduction

Assembly Definitions (asmdef) and Assembly References (asmref) are assets in Unity that combine scripts into assemblies and manage the relationship between sets of assemblies.

This is useful for reducing the compilation time as changing a script in a single assembly does not necessarily needs all other assemblies to be re-compiled.

For more information, take a look at Unity's documentation on Assembly Definitions.

Quantum Assembly Definitions

By default, Quantum 3 comes with a set of Assembly Definition and Assembly Reference files which encapsulates multiple parts of the SDK code. Here is a list, by searching in the project with Unity's Search tool (Ctrl + K):

Find here more information those assemblies about the Quantum dependencies.

User folders that are installed with the SDK have Assembly Reference files to add their content to a SDK asmdef. For example, the folder Assets/QuantumUser/Simulation has an Quantum.Simulation.asmref which gives access to Quantum.Simulation assembly's types.

When creating a new folder in a different location, add your own asmref file to reference the desired asmdef.

Removing Assembly Definitions

The Quantum Unity SDK asmdefs are strict and there may be hindrances especially with the Quantum.Unity.dll to solve custom dependencies. Although beneficial for the editor compilation performance, Quantum asmdefs can be removed.

We do not recommend removing them as it degrades the compilation time, makes it impossible to run the Quantum simulation outside of Unity (e.g. console runner, custom plugin) and also because setting encapsulation boundaries is a way of keeping things in control.

A step-by-step guide to remove asmdef files from a project:

  1. Delete the following asmdef files:
  1. Delete the following asmref files:
  1. Select the Quantum.Unity.Editor.CodeGen.asmdef file and mark it as Auto Referenced;
  1. Set QUANTUM_UNITY in the project's scripting symbols, make sure to set this for all platforms;

  2. Also set the following scripting symbols, accordingly to the project's needs:

  • QUANTUM_ENABLE_PHYSICS2D
  • QUANTUM_ENABLE_PHYSICS3D
  • QUANTUM_ENABLE_AI
  • QUANTUM_ENABLE_AI_NAVIGATION
  • QUANTUM_ENABLE_TERRAIN
  • QUANTUM_ENABLE_ADDRESSABLES
  • QUANTUM_ENABLE_TEXTMESHPRO

Last updated on

Back to top