Skip to content
Snippets Groups Projects
Commit 73f48bd5 authored by William MacDonald (Student)'s avatar William MacDonald (Student)
Browse files

Add confirmation dialogue when saving and update saving process to be up to date with API

parent 94d99993
No related branches found
No related tags found
1 merge request!10Evaluation
......@@ -69,7 +69,9 @@ public class JsonRenderSettingUnityPackageSaver : IFileRenderSettingSaver
{
//Path of blueprint relative to preset root
PrefabUtility.CreatePrefab(presetsRoot + preset.GetName() + "/VisualBlueprints/" + blueprint.GetName() + ".prefab", blueprint.GetBlueprintObject());
var prefab = (GameObject)PrefabUtility.InstantiatePrefab(blueprint.GetBlueprintObject());
PrefabUtility.SaveAsPrefabAsset(prefab, presetsRoot + preset.GetName() + "/VisualBlueprints/" + blueprint.GetName() + ".prefab");
GameObject.DestroyImmediate(prefab);
return "VisualBlueprints/" + blueprint.GetName() + ".prefab";
}
......
......@@ -114,7 +114,11 @@ public class RenderSettingPanel : IObserver<IRenderSetting>
if (GUILayout.Button("Save", GUILayout.Width(50)))
{
settingsSaver.Save(preset, "Assets/RenderStyles/");
if (EditorUtility.DisplayDialog("Save preset",
"Are you sure you want to save preset " + preset.GetName() + "?", "Save", "Cancel"))
{
settingsSaver.Save(preset, "Assets/RenderStyles/");
}
}
if (GUILayout.Button("Close", GUILayout.Width(100)))
......
......@@ -52,7 +52,7 @@ public class VisualBlueprintPanel
private void RemoveVisualBlueprint(IVisualBlueprint blueprint)
{
if (EditorUtility.DisplayDialog("Remove blueprint?",
"Are you sure you want to remove blueprint" + blueprint.GetName() + "?", "Remove", "Cancel"))
"Are you sure you want to remove blueprint " + blueprint.GetName() + "?", "Remove", "Cancel"))
{
this.preset.RemoveVisualBlueprint(blueprint);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment