/// <summary> /// Synchronizes project with MVC configuration. /// </summary> public static void Sync(MvcConfig config) { config.Save(); MvcWorkspace.AutogenMVC(config); for (int i = 0; i < config.Views.Count; i++) { MvcWorkspace.AutogenView(config.Views[i]); } AssetDatabase.Refresh(); }
public override void OnInspectorGUI() { serializedObject.Update(); if (!MvcWorkspace.HasValidWorkspace()) { UninitializedView.Render(this); } else if (!MvcResources.IsValid()) { ResourceErrorView.Render(this); } else { InitializedView.Render(this); } serializedObject.ApplyModifiedProperties(); }
/// <summary> /// Use this method to show a dialog for setting new workspace directory. /// </summary> public static void SelectWorkspaceDirectory() { // Get valid folder path string folderPath = EditorDialog.OpenDirectory(); if (string.IsNullOrEmpty(folderPath)) { return; } if (!NyanPath.IsStandardProjectPath(folderPath)) { EditorDialog.OpenAlert( "Error", "Workspace must be placed inside the project, but outside of StreamingAssets, Resources, " + "Plugins, and Editor folder." ); return; } // Setup workspace MvcWorkspace.SetWorkspace(folderPath); }