public static void OnOverridenPrefabsInspector(GameObject gameObject)
{
GUI.enabled = true;
Object prefabObject = PrefabUtility.GetPrefabObject(gameObject);
if (prefabObject != null)
{
EditorGUIUtility.labelWidth = 200f;
if (PrefabUtility.GetPrefabType(gameObject) == PrefabType.PrefabInstance)
{
PropertyModification[] propertyModifications = PrefabUtility.GetPropertyModifications(gameObject);
if ((propertyModifications != null) && (propertyModifications.Length != 0))
{
GUI.changed = false;
for (int i = 0; i < propertyModifications.Length; i++)
{
propertyModifications[i].value = EditorGUILayout.TextField(propertyModifications[i].propertyPath, propertyModifications[i].value, new GUILayoutOption[0]);
}
if (GUI.changed)
{
PrefabUtility.SetPropertyModifications(gameObject, propertyModifications);
}
}
}
AddComponentGUI(prefabObject);
}
}
}