DataTable Attribute

Attribute to draw the members of a serialized struct or class in a table instead of a dropdown

Parameters:
  • optional, bool drawInBox: Draw the table members in a nice box

  • optional, bool showLabels: Show the labels of the members

Example:

using System;
using UnityEngine;
using EditorAttributes;

public class AttributesExample : MonoBehaviour
{
        [Serializable]
        private struct Data
        {
                public int intField;
                public float floatField;
                public string stringField;
                public bool boolField;
        }

        [SerializeField, DataTable] private Data structField;
        [SerializeField, DataTable] private Data[] structArray;
}
../../_images/DataTable01.png