Quantcast
Channel: Answers by "Soviut"
Viewing all articles
Browse latest Browse all 23

Answer by Soviut

$
0
0
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

Viewing all articles
Browse latest Browse all 23

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>