public override bool InspectSelf(Inspector inspector, string name, ref object data, Type type) { var e = data as Enum; if (e == null) { return(false); } if (TypeTools.GetAttribute <FlagsAttribute>(type) != null) { return(ApplyValueIfNotEqual(ref data, GUITools.EnumMaskField(name, e))); } else { return(ApplyValueIfNotEqual(ref data, GUITools.EnumPopup(name, e))); } }
public override bool InspectChildren(Inspector inspector, string path, ref object data, Type type) { var time = (DateTime)data; GUITools.LabelField("Unix Time Stamp", ToUnixTimestampString(time)); var ticks = GUITools.LongField("Ticks", time.Ticks); var kind = (DateTimeKind)GUITools.EnumPopup("Kind", time.Kind); if (ticks != time.Ticks || kind != time.Kind) { try { data = new DateTime(ticks, kind); return(true); } catch (Exception) { } } return(false); }