/// <summary> /// Save gameobject as prefab. /// </summary> /// <param name="go">Original gameobject.</param> /// <returns>Prefab.</returns> protected GameObject Save(GameObject go) { var style = Style.DefaultStyle(); if (style != null) { style.ApplyTo(go); } var filename = PrefabSavePath + "/" + go.name + ".prefab"; var prefab = Compatibility.CreatePrefab(filename, go); Utilites.SetPrefabLabel(prefab); UnityEngine.Object.DestroyImmediate(go); return(prefab); }