- Home /
How do I Programmatically save project with C#?
I'm trying to make a tool that will import assets the artist have created into unity. One of the key things I want to do is have Unity save project after it is checked out/added to Perforce and before it submits it so everyone can suck it down onto their own computer.
(Saving the scene will not work since we instantiate objects at runtime and have no objects in the actual scene. Thus we need to save prefabs in the project instead of the scene.)
Answer by Flexford · Mar 19, 2019 at 06:02 PM
EditorApplication.ExecuteMenuItem("File/Save Project");
Answer by Jamora · Oct 03, 2013 at 07:39 PM
EditorApplication.SaveAssets might be what you're looking for. Maybe.
That looks like it might work, I'll try it out and see if it works. Thanks!
In Unity 2017 it is now called AssetDatabase.SaveAssets
Your answer
Follow this Question
Related Questions
Editor script - any callback when target is first instantiated? 1 Answer
Font in Unity Editor is too smooth 0 Answers
Note3 Shadows Gone 0 Answers
ShaderGraph-like EditorWindow 0 Answers
Different Object on different screen 0 Answers