Pending Review

2.0.0a10 Switch on Enum unit losing type and dropping connections.

NeedsLoomis 4 months ago updated 3 months ago 2

My Switch on Enum units will often go bad (all of them simultaneously across the project).  I see it most often on Unity restart, and when compiling code with errors.  Switching the Type to a different Enum and back again on each unit will fix it until next time.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
Pending Review

Hi NeedsLoomis,

Thanks for the report.

Is there any more specific reproduction steps you could provide? Especially any operation that will always cause it to break would be really helpful.

In the mean time, my guess is that the enum class asset may not be properly registered as a serialization dependency of the unit, so the node tries to define before the enum has loaded, but that is just a hypothesis I'd have to confirm.

Sorry it took so long, lost track of time.
Thankfully this one turned out pretty easy to reproduce on my end.

Create new enum, add elements.
Create a new class.
Create a function graph with a switch on enum for your enum.
Create a game object and add your bolt component and class to it.
Restart Unity, the connections should now be broken.