EditorUtility.ReplacePrefab Manual     Reference     Scripting  
Scripting > Editor Classes > EditorUtility

static function ReplacePrefab (go : GameObject, targetPrefab : Object, options : ReplacePrefabOptions = ReplacePrefabOptions.Default) : GameObject


Replaces the targetPrefab with a copy of the game object hierarchy go.

Returns the prefab game object after it has been created. If connectToPrefab is enabled go will be made an instance of the created prefab.