SolidAlloy / GenericScriptableArchitecture

ScriptableObject architecture with small, easy-to-expand codebase, and simple UI.
Other
120 stars 13 forks source link

[Bug] Issues when displaying nested variables #12

Open Ivan-Vankov opened 2 years ago

Ivan-Vankov commented 2 years ago

Let's say we have the following code:

[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: image 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: image 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.