You should now be using [PrefabUtility][1], not EditorUtility for all prefab operations. Not only does it have a method for creating empty prefabs but it also has a method to [create prefabs from existing GameObjects][2]:
GameObject prefab = PrefabUtility.CreatePrefab("Assets/Whatever.prefab", (GameObject)Selection.object, ReplacePrefabOptions.ReplaceNameBased);
[1]: http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.html
[2]: http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.CreatePrefab.html
↧