[Serializable]
public class NestedVar {
public int nestedValue;
}
[Serializable]
public class BaseVar {
public Reference<NestedVar> nestedVar;
public bool baseValue;
}
Then we create variables of type BaseVar and NestedVar.
In the dropdown for Nested Var in BaseVar we choose Variable.
When we assign the NestedVar variable there it displays like this in edit mode:
The initial value of Nested Var is displayed after Base Value.
It is on the same indentation level as Nested Var.
This becomes worse when you add more nested vars.
They all display on the bottom with the same indentation and you don't know which initial value belongs to what.
In play mode it looks like this:
The current value of Nested Var is displayed on the top-right of the initial value and is misaligned with everything else.
It also hides the trigger that enables you to edit the initial value in play mode.
Let's say we have the following code:
Then we create variables of type BaseVar and NestedVar. In the dropdown for Nested Var in BaseVar we choose Variable. When we assign the NestedVar variable there it displays like this in edit mode: The initial value of Nested Var is displayed after Base Value. It is on the same indentation level as Nested Var. This becomes worse when you add more nested vars. They all display on the bottom with the same indentation and you don't know which initial value belongs to what.
In play mode it looks like this: The current value of Nested Var is displayed on the top-right of the initial value and is misaligned with everything else. It also hides the trigger that enables you to edit the initial value in play mode.