+2
Not a Bug

Custom Units Not Added To UnitOptions in 2.0a5

JasonJonesLASM 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 6

Non Ludiq based Custom Units are not added to the UnitOptions database on extraction. It is skipped entirely. I was able to fix this with your suggestion of looping over runtimeTypes instead of ludiqRuntimeTypes in GetStaticOptions. 

Bolt Version:
2.0a5
Unity Version:
2019.1.4
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Bolt 2

Hi there! Is there any news about this bug? It seems that I have encountered it, all custom blocks disappeared and that is a blocker, I can't add any custom block to the chart.

+2

Here is the solution for now. It's temporary, and will unfortunately show obsolete units in the finder, but at least you'll have access.

Find the source file UnitOptionsExtractor.cs. Goto line 359 and change ludiqRuntimeTypes to runtimeTypes. 

() => options.UnionWith(Codebase.ludiqRuntimeTypes.SelectWhereTask("Standalones...", IsStandaloneUnitType, InstantiateStandaloneUnitType)),

to

() => options.UnionWith(Codebase.runtimeTypes.SelectWhereTask("Standalones...", IsStandaloneUnitType, InstantiateStandaloneUnitType)),
+1

The issue appears to come from IsLudiqRuntimeDependentAssembly (Codebase.cs line 258) returning false for your assembly.

My workaround is to make use of [DoNotSerialize] or [Serialize] in the CustomUnit to ensure that the assembly has a reference to Ludiq.Core.Runtime.

Not a Bug

Hi everyone,

Sorry for the late reply on this.

I looked over the code and I believe the behaviour is correct, to only look in Ludiq-dependent runtime types. 

I'd need more information about the overall setup (asmdef files, script locations, etc.) of your custom units assembly to know why it isn't referencing Ludiq.Core.Runtime -- if it isn't, then how can it create classes derived from Ludiq.Bolt.Unit?