#2 fields of same type. FindPropertyRelative returns something for the 1st and null for the 2nd.

1 messages · Page 1 of 1 (latest)

gusty arch
#

I tried reordering my fields, to see if it was due of the property being last, but it did not change anything.

granite yacht
#

You need to provide more context

gusty arch
#

Found the issue a few minutes ago.
To give context: I have this class whose DefinitionItems field I'm trying to access through FindPropertyRelative()

[System.Serializable]
public class CollectionComponentDefinition<TItem> : CollectionComponentDefinition where TItem : struct, IComponentItem
{
    [UnityEngine.SerializeField]
    public TItem[] DefinitionItems = System.Array.Empty<TItem>();
  /* ... */
}

The issue was that TItem sometimes represented a type that was not marked as [System.Serializable].