Support for tuple variable names in inspector

Issue #826 closed
John Stock created an issue

I have the following that shows in the inspector:

[SerializeField] public List<(CollectionSO Collection, float Weight)> CollectionSOs = new List<(CollectionSO Collection, float Weight)>();

The value type tuple has two variables that are named, (Collection and Weight), however the inspector just shows them as item1 and item2

I’ve attached a screenshot showing this

Odin 3.0.12.0, Unity 2020.3.24f1, Windows 10

Comments (1)

  1. Antonio Rafael Antunes Miranda

    Named tuples are largely syntactic sugar, the compiler doesn't use the names you set for them, but rather Item1, Item2, ... Obtaining this information is very difficult and often simply impossible. I’d sugest to create classes/structs instead.

  2. Log in to comment