Manual     Reference     Scripting  
  
Scripting > Editor Classes > EditorUtility   

EditorUtility.ReplacePrefab  

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

Description

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.