Object tempPrefab =
EditorUtility.CreateEmptyPrefab("Assets/res/audio/AudioSourcePrefab/"
+ gameObject.name + ".prefab");
tempPrefab =
EditorUtility.ReplacePrefab(gameObject, tempPrefab);
原文:http://www.cnblogs.com/chenan/p/3547670.html