Almost any project will eventually have custom data or reference types. These types can also be used as Unity Atoms variables or passed along as event data. Use the generator to create atoms for your own project specific types.
The Generator is a powerful tool that allows you to generate your own Atoms fast and easy via an Unity editor window. It liberates you from writing otherwise tedious boilerplate code and lets you instead focus on what is important.
The Generator can be found by clicking on _Tools / Unity Atoms / Generator_ in the top menu bar:
Is the type provided in the above field implementing [`IEquatable`](https://docs.microsoft.com/en-us/dotnet/api/system.iequatable-1?view=netframework-4.8)? You need to add the following to `MyStruct` to make it implement `IEquatable`:
If your type does not implement [`IEquatable`](https://docs.microsoft.com/en-us/dotnet/api/system.iequatable-1?view=netframework-4.8) you will need to manually implement the `ValueEquals` method in the generated `AtomVariable`.
You would then enter `MyNamespace`as the type namespace.
### Sub Unity Atoms namespace
By default the Atoms that gets generated will be under the namespace `UnityAtoms`. If you for example like it to be under `UnityAtoms.MyNamespace` you would then enter `MyNamespace` in this field.
This is a list of Atom types that you want to generate. Simply select the Atoms that you want to generate. Some Atoms depend on other Atoms. If you unselect an Atom that other Atoms depend on, then the Generator will unselect those depending Atoms. Below you find the dependency graph:
- Event Reference Listener - depends on Action, Variable, Event, Pair Event, Function x 2, Variable Instancer, Pair Event Reference and Unity Event and Pair.
- Pair Event Reference Listener - depends on Pair Action, Variable, Event, Pair Event, Function x 2, Variable Instancer, Event Reference and Pair Unity Event and Pair.
- Reference - depends on Constant, Variable, Event, Pair Event, Function x 2 and Variable Instancer and Pair.