diff --git a/Assets/Fungus/Camera/Editor/CameraMenuItems.cs b/Assets/Fungus/Camera/Editor/CameraMenuItems.cs index 51f7c15d..4249f4c3 100644 --- a/Assets/Fungus/Camera/Editor/CameraMenuItems.cs +++ b/Assets/Fungus/Camera/Editor/CameraMenuItems.cs @@ -18,7 +18,7 @@ namespace Fungus GameObject prefab = Resources.LoadAssetAtPath("Assets/Fungus/Camera/Prefabs/" + prefabName + ".prefab", typeof(GameObject)) as GameObject; if (prefab != null) { - GameObject go = GameObject.Instantiate(prefab) as GameObject; + GameObject go = PrefabUtility.InstantiatePrefab(prefab) as GameObject; go.name = prefabName; } } diff --git a/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs b/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs index 1db612fe..d6a66003 100644 --- a/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs +++ b/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs @@ -43,7 +43,7 @@ namespace Fungus GameObject prefab = Resources.LoadAssetAtPath("Assets/Fungus/Dialog/Prefabs/" + prefabName + ".prefab", typeof(GameObject)) as GameObject; if (prefab != null) { - GameObject go = GameObject.Instantiate(prefab) as GameObject; + GameObject go = PrefabUtility.InstantiatePrefab(prefab) as GameObject; go.name = prefabName; } } diff --git a/Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs b/Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs index 66a2710b..348a08e7 100644 --- a/Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs +++ b/Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs @@ -19,7 +19,7 @@ namespace Fungus GameObject prefab = Resources.LoadAssetAtPath("Assets/Fungus/Sprite/Prefabs/" + prefabName + ".prefab", typeof(GameObject)) as GameObject; if (prefab != null) { - GameObject go = GameObject.Instantiate(prefab) as GameObject; + GameObject go = PrefabUtility.InstantiatePrefab(prefab) as GameObject; go.name = prefabName; } }