garettbass / UnityExtensions.ArrayDrawer

ArrayDrawer is a base class like PropertyDrawer, but for arrays and lists.
MIT License
131 stars 21 forks source link

Default values for properties are not set #19

Open rutkoski opened 3 years ago

rutkoski commented 3 years ago

When you add the first element to a list of a subtype, the subtype's default property values are not set.

Ex.:

public class Subtype {
  public int value = -1;
}

public Subtype[] values;

values[].value is created as 0, not -1.

garettbass commented 3 years ago

This is an issue with Unity, not the array drawer. It is only responsible for rendering the array with a more useful UI