Browse Source

Change FlowchartMenuItem.SpawnPrefab to GameObject.Inst rather than PrefabUtil to avoid exception modifications.empty

Avoids or allows Unity to internally deal with the assertion that arrise from PrefabUtil when passing a prefab with UI elements. Change is not a concern here as in this case we are intentionally removing the prefab link that would be able to be maintained by the PrefabUtil.
master
desktop-maesty/steve 6 years ago
parent
commit
4ef3f2a3fb
  1. 4
      Assets/Fungus/Scripts/Editor/FlowchartMenuItems.cs

4
Assets/Fungus/Scripts/Editor/FlowchartMenuItems.cs

@ -58,8 +58,8 @@ namespace Fungus.EditorUtils
return null;
}
GameObject go = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
PrefabUtility.DisconnectPrefabInstance(go);
GameObject go = GameObject.Instantiate(prefab) as GameObject;
go.name = prefab.name;
SceneView view = SceneView.lastActiveSceneView;
if (view != null)

Loading…
Cancel
Save