Skip to content

LogicEditor | Remove dependency of SimpleText on SimpleVrUi Module

Summary

v0.4.2's SimpleText node of the LogicEditor currently relies on the SimpleVrUiTextManager to correctly identify a text panel. This is problematic, as we need to reference the whole SimpleVrUi module in the LogicEditors assembly reference and we want to minimize cross references (we try to learn from our mistakes).

Problem or need

Identifying a text panel correctly would break if the SimpleVrUi module was removed or changed upstream. Using this was a crutch only taken because of objects that could contain multiple TMP_Text components, which makes identifying the correct component not trivial.

Proposed solution

Switch to a tag-based approach where TextPanels use a specific tag, e.g. textPanel. Then, instead of checking if SimpleVrUiTextManager exists on the connected LogicObject, check if it has the correct tag. That way, we do not need to rely on another module for a simple type check.

Alternatives considered

Another approach would be to further abstract the concept of panels that can contain varying content to MediaPanels. This is still on the table, but will take more time (as handling video, audio, image and text in a single construct is more complex than our SimpleText approach).

Additional context

N/A