Пример #1
0
        /// <summary>
        ///     Import a project
        /// </summary>
        public void ImportProject()
        {
            // Check the path
            var paths = StandaloneFileBrowser.OpenFolderPanel("", "", false);

            if (paths.Length == 0 || paths[0].Equals(""))
            {
                return;
            }
            dialog.Show(
                "Open Project",
                "Open the project?",
                () =>
            {
                // Show the loading screen
                loadingScreen.ShowLoadingScreen(
                    () => _projectManager.LoadProject(paths[0]),
                    result =>
                {
                    // Check if the object was loaded
                    var(success, message) = result;
                    if (!success)
                    {
                        toast.Error(Toast.Short, message);
                        return;
                    }

                    // Load the OBJ model
                    var(loadSuccess, loadMessage) = _projectManager.LoadModel(false);
                    if (!loadSuccess)
                    {
                        toast.Error(Toast.Short, loadMessage);
                        return;
                    }

                    // Show the new project
                    gameObject.SetActive(false);
                    mainController.ShowEditor();
                    SaveWindowConfig();
                },
                    2000
                    );
            }
                );
        }