コード例 #1
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);
        }
コード例 #2
0
        IEnumerator CreateNewPackageAsync()
        {
            var userInput = _view.PromptForInput("Enter new package name:", "Untitled");

            yield return(userInput);

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

            yield return(_prjCommandHandler.ProcessPrjCommand(
                             "Creating Package '{0}'".Fmt(userInput.Current), PrjHelper.CreatePackageAsync(userInput.Current)));

            yield return(_packageHandler.RefreshPackagesAsync());
        }
コード例 #3
0
        IEnumerator CreateNewPackageAsync()
        {
            var userInput = _view.PromptForInput("Enter new package name:", "Untitled");

            yield return(userInput);

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

            var packageName = userInput.Current;
            var packageDir  = PrjPathVars.Expand(Path.Combine(_model.GetCurrentPackageFolderPath(), packageName));

            Log.Debug("Creating new package directory at '{0}'", packageDir);
            Directory.CreateDirectory(packageDir);

            yield return(_packageHandler.RefreshPackagesAsync());
        }
コード例 #4
0
        IEnumerator AddAsRegexAsync()
        {
            var userInput = _view.PromptForInput("Enter Python Regex below.\n (note: see python documentation for reference)", ".*");

            yield return(userInput);

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

            Assert.That(!userInput.Current.StartsWith("/"), "When entering the regex, you do not need to prefix it with a slash");

            _model.AddVsProject("/" + userInput.Current);
        }