private static void DrawProperties(SteamSync sync, SteamSync.SavedEntry saved, int index)
    {
        if (saved.target == null)
        {
            return;
        }

        var fields = saved.target.GetType().GetFields(
            BindingFlags.Instance | BindingFlags.Public);

        var properties = saved.target.GetType().GetProperties(
            BindingFlags.Instance | BindingFlags.Public);

        var old_index = 0;
        var names     = new List <string> {
            "<None>"
        };

        foreach (var t in fields)
        {
            if (!CanBeSerialized(t.FieldType))
            {
                continue;
            }
            if (t.Name == saved.property_name)
            {
                old_index = names.Count;
            }
            names.Add(t.Name);
        }
        foreach (var pi in properties)
        {
            if (!CanBeSerialized(pi.PropertyType) || !pi.CanWrite || !pi.CanRead)
            {
                continue;
            }
            if (pi.Name == saved.property_name)
            {
                old_index = names.Count;
            }
            names.Add(pi.Name);
        }

        var newIndex = EditorGUILayout.Popup(old_index, names.ToArray());

        GUI.backgroundColor = Color.red;
        var delete = GUILayout.Button("X", GUILayout.Width(24f), GUILayout.Height(14f));

        if (delete)
        {
            sync.entries.RemoveAt(index);
            EditorUtility.SetDirty(sync);
            return;
        }
        if (newIndex != old_index)
        {
            saved.property_name = (newIndex == 0) ? "" : names[newIndex];
            EditorUtility.SetDirty(sync);
        }
    }
    public override void OnInspectorGUI()
    {
        var sync       = target as SteamSync;
        var components = GetComponents(sync);
        var names      = GetComponentNames(components);

        GUILayout.Space(10);
        GUILayout.BeginVertical("Steam Multiplayer Sync", "window", GUILayout.Height(10));
        EditorGUILayout.BeginVertical("box");
        for (var i = 0; i < sync.entries.Count;)
        {
            GUILayout.BeginHorizontal();
            {
                if (DrawTarget(sync, i, components, names))
                {
                    DrawProperties(sync, sync.entries[i], i);
                    ++i;
                }
            }
            GUILayout.EndHorizontal();
        }

        GUI.backgroundColor = Color.green;
        if (GUILayout.Button("Add a New Synchronized Property"))
        {
            var ent = new SteamSync.SavedEntry {
                target = components[0]
            };
            sync.entries.Add(ent);
            EditorUtility.SetDirty(sync);
        }

        GUI.backgroundColor = Color.white;
        EditorGUILayout.EndVertical();

        GUILayout.Space(4f);
        EditorGUILayout.BeginVertical("box");
        sync.syn_mode = (SyncMode)EditorGUILayout.EnumPopup("Mode", sync.syn_mode);
        var updates = EditorGUILayout.IntField("Updates Per Second", sync.updatesPerSecond);

        EditorGUILayout.EndVertical();
        GUILayout.EndVertical();
        if (sync.updatesPerSecond != updates)
        {
            EditorUtility.SetDirty(sync);
            sync.updatesPerSecond = updates;
        }
    }