static KeyValuePair<GUIContent, System.Action>[] GetButtonsData(PEPrefabScript prefabInstance, SerializedProperty prefabProperty, SerializedProperty instanceProperty) { var buttons = new KeyValuePair<GUIContent, System.Action>[] { new KeyValuePair<GUIContent, System.Action>(new GUIContent("Revert", "Revert property to prefab value"), () => { if (prefabProperty == null) return; if (instanceProperty.propertyType == SerializedPropertyType.ObjectReference) { var link = prefabInstance.GetDiffWith().Links[prefabProperty.objectReferenceValue]; if (link == null) instanceProperty.SetPropertyValue(prefabProperty.GetPropertyValue()); else { var instanceLink = prefabInstance.Links[link]; if (instanceLink != null) instanceProperty.SetPropertyValue(prefabInstance.Links[link].InstanceTarget); else { if (PEPrefs.DebugLevel > 0) Debug.Log("Link null"); instanceProperty.SetPropertyValue(prefabProperty.GetPropertyValue()); } } } else { instanceProperty.SetPropertyValue(prefabProperty.GetPropertyValue()); } instanceProperty.serializedObject.ApplyModifiedProperties(); }), new KeyValuePair<GUIContent, System.Action>(new GUIContent("Update", "Update changes"), () => EditorApplication.delayCall += prefabInstance.BuildModifications), }; return buttons; }