示例#1
0
        /// <summary>
        /// Sets up the current scene and creates a new training course for this scene.
        /// </summary>
        /// <param name="courseName">Name of the training course.</param>
        public static void SetupSceneAndTraining(string courseName)
        {
            TrainingSceneSetup.Run();

            string errorMessage = null;

            if (CourseAssetUtils.DoesCourseAssetExist(courseName) || CourseAssetUtils.CanCreate(courseName, out errorMessage))
            {
                if (CourseAssetUtils.DoesCourseAssetExist(courseName))
                {
                    CourseAssetManager.Load(courseName);
                }
                else
                {
                    CourseAssetManager.Import(EntityFactory.CreateCourse(courseName));
                    AssetDatabase.Refresh();
                }

                SetCourseInCurrentScene(courseName);
            }

            if (string.IsNullOrEmpty(errorMessage) == false)
            {
                Debug.LogError(errorMessage);
            }

            try
            {
                EditorSceneManager.SaveScene(SceneManager.GetActiveScene());
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
            }
        }
示例#2
0
        public void Setup()
        {
            if (RuntimeConfigurator.Exists)
            {
                return;
            }

            TrainingSceneSetup.Run();
        }
示例#3
0
 public static void SetupScene()
 {
     TrainingSceneSetup.Run();
 }