示例#1
0
        internal static void RunStartupCode()
        {
            var projectSettings = TutorialProjectSettings.instance;

            if (projectSettings.initialScene != null)
            {
                EditorSceneManager.OpenScene(AssetDatabase.GetAssetPath(projectSettings.initialScene));
            }

            TutorialManager.WriteAssetsToTutorialDefaultsFolder();

            if (projectSettings.startupTutorial != null)
            {
                TutorialManager.instance.StartTutorial(projectSettings.startupTutorial);
            }

            // Ensure Editor is in predictable state
            EditorPrefs.SetString("ComponentSearchString", string.Empty);
            Tools.current = Tool.Move;

            // Replace LastProjectPaths in window layouts used in tutorials so that e.g.
            // pre-saved Project window states work correctly.
            var readme = TutorialWindow.FindReadme();

            if (readme)
            {
                WindowLayoutProxy.ReplaceLastProjectPathWithCurrentProjectPath(readme.projectLayoutPath);
            }

            AssetDatabase.FindAssets($"t:{typeof(Tutorial).FullName}")
            .Select(guid =>
                    AssetDatabase.LoadAssetAtPath <Tutorial>(AssetDatabase.GUIDToAssetPath(guid)).windowLayoutPath
                    )
            .Distinct()
            .ToList()
            .ForEach(layoutPath =>
            {
                WindowLayoutProxy.ReplaceLastProjectPathWithCurrentProjectPath(layoutPath);
            });

            if (readme != null)
            {
                readme.LoadTutorialProjectLayout();
            }

            var welcomePage = FindWelcomePage();

            if (welcomePage != null)
            {
                TutorialModalWindow.TryToShow("Welcome", welcomePage, () => { });
            }

            var wnd = TutorialManager.GetTutorialWindow();

            if (wnd)
            {
                wnd.showStartHereMarker = true;
            }
        }
示例#2
0
 static void SaveOriginalWindowLayout()
 {
     WindowLayoutProxy.SaveWindowLayout(k_OriginalLayoutPath);
 }
示例#3
0
 static void SaveOriginalWindowLayout()
 {
     // Save current layout so we can restore it later
     WindowLayoutProxy.SaveWindowLayout(k_OriginalLayoutPath);
 }