REFLECTION SYSTEM

A homemade reflection system built with the intent to save a lot of time for me and other programmers. Easy of use was also a high priority.

This is the interface for reflecting an int. When creating a new reflector, one simply has to implement the functions one need.

BUILT USING VISITOR PATTERN

The reflection system is built using visitor pattern where each type we can reflect on is visitable.

It is very powerful and some nice systems and features has been built using it. Read more below!

Note that being a visitor pattern, performance issues will arise at some point, we have not reached that point yet though.

SYSTEMS BUILT USING THE RELFECTION SYSTEM

The below showcases show images and examples made by reflecting what is shown in this image below.

EXPOSE VARIABLES IN INSPECTOR

A programmer can with 1 line of code expose a variable into the inspector that is now viewable and modifyable.

SUPPORTS ARRAYS AND CUSTOM TYPES

A more common example would look like this that has reflected types within each other and arrays with some nice header and separators.

AUTO-GENERATED VISUAL SCRIPT NODES

Nodes for the visual scripting are for each component that is reflected is automatically generated to easily get or set component values within the visual script.

AUTOMATIC SERIALIZATION/DESERIALIZATION

Automatically serialized based on all the reflected values, can also easily change serialization method because it uses a generic interface. If we wanted binary serialization, we need just implement an interface.

AUTOMATIC RESOURCE REFERENCES HANDLING

When saving the scene, a list of resources gets written of all the resources that are reflected in each component to easily know what resource to load when loading a scene. This opens up the ability to load all the resources immediately on separate threads while loading other stuff from the scene simultanously.

GAMEOBJECT PREFAB SYSTEM

GameObject prefabs are also built upon this reflection system, you can read more about it on the editor page.