0
Postponed

2.0.0a7 Lists and Dictionaries don't support Class Asset types.

Ex-Crow 4 months ago updated by Lazlo Bonin (Lead Developer) 4 months ago 1

I can create a variable with a Class Asset type of Item:



But I can't do the same with Lists and Dictionaries:



I can do lists of type ClassAsset but it doesn't appear to work when I try to use it:


Graph: https://imgur.com/IsfQkbO



The same logic works as intended with a C# scriptable object in the place of a Class Asset:

Graph: https://imgur.com/Eq9K99T


So the source of the issue seems that lists don't support Class Asset types.

Bolt Version:
2.0.0a7
Unity Version:
2019.2.18
Platform(s):
PC
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
Postponed

Hi TowerCrow,

This is a known limitation of the Bolt type system.

Bolt types cannot be used as generic parameters for C# generic types. 

Eventually, I'd like to fix this by creating our own intermediary representation for live generic types, but that is out of scope for Bolt 2.0.

In the mean time, the suggested workaround is to use a List<GameObject> or List<UnityEngine.Object> and let Bolt do the conversion on each item as needed.