コード例 #1
0
        IEnumerator ShowCreateNewProjectPopupAsync()
        {
            while (!_windowInitializer.IsInitialized)
            {
                yield return(null);
            }

            var choices = ShowPopup();

            yield return(choices);

            if (choices.Current == null)
            {
                // User Cancelled
                yield break;
            }

            var projName          = choices.Current.NewProjectName;
            var duplicateSettings = choices.Current.DuplicateSettings;

            yield return(_commandHandler.ProcessPrjCommand(
                             "Creating Project '{0}'".Fmt(projName), PrjHelper.CreateProjectAsync(projName, duplicateSettings)));

            yield return(_commandHandler.ProcessPrjCommand(
                             "Initializing directory links", PrjHelper.UpdateLinksAsyncForProject(projName)));

            yield return(_commandHandler.ProcessPrjCommand(
                             "Opening Unity", PrjHelper.OpenUnityForProjectAsync(projName)));

            EditorApplication.Exit(0);
        }
コード例 #2
0
        IEnumerator ShowCreateNewProjectPopupAsync()
        {
            while (!_windowInitializer.IsInitialized)
            {
                yield return(null);
            }

            var userInput = _view.PromptForInput("Enter new project name:", "Untitled");

            yield return(userInput);

            if (userInput.Current == null)
            {
                // User Cancelled
                yield break;
            }

            var projName = userInput.Current;

            yield return(_commandHandler.ProcessPrjCommand(
                             "Creating Project '{0}'".Fmt(projName), PrjHelper.CreateProjectAsync(projName)));

            yield return(_commandHandler.ProcessPrjCommand(
                             "Initializing directory links", PrjHelper.UpdateLinksAsyncForProject(projName)));

            yield return(_commandHandler.ProcessPrjCommand(
                             "Opening Unity", PrjHelper.OpenUnityForProjectAsync(projName)));

            EditorApplication.Exit(0);
        }