Example #1
0
        private void Update()
        {
            Properties.Clear();

            if (EditableComponents.Count != 1)
            {
                return;
            }

            var description = DescriptionLookup.GetDescription(EditableComponents[0].Type);

            foreach (var property in EditableComponents[0].Properties)
            {
                Properties.Add(new EditableProperty
                {
                    Component            = EditableComponents[0],
                    Property             = description.Properties.FirstOrDefault(x => x.SerializedName == property.Key),
                    ComponentDescription = description,
                    ValueChanged         = () => ComponentPropertyChanged(EditableComponents[0])
                });
            }
        }
 public static string ToDescription <T>(this T value) where T : struct
 {
     return(DescriptionLookup <T> .GetDescription(value));
 }