private Task StartUnity(Lifetime lifetime)
        {
            var commandLines = myUnityController.GetUnityCommandline();
            var unityPath    = commandLines.First();
            var unityArgs    = string.Join(" ", commandLines.Skip(1));
            var process      = new Process()
            {
                StartInfo = new ProcessStartInfo(unityPath, unityArgs)
            };

            process.Start();

            return(myUnityController.WaitConnectedUnityProcessId(lifetime));
        }
Esempio n. 2
0
        private Task StartUnityIfNeed()
        {
            var needStart = MessageBox.ShowYesNo("Unity Editor has not started yet. Run it?", "Unity plugin");

            if (!needStart)
            {
                throw new Exception(NotAvailableUnityEditorMessage);
            }

            var commandLines = myUnityController.GetUnityCommandline();
            var unityPath    = commandLines.First();
            var unityArgs    = string.Join(" ", commandLines.Skip(1));
            var process      = new Process
            {
                StartInfo = new ProcessStartInfo(unityPath, unityArgs)
            };

            process.Start();

            return(myUnityController.WaitConnectedUnityProcessId());
        }
        private Task StartUnityIfNeed(Lifetime lifetime)
        {
            var message = string.Format(StartUnityEditorQuestionMessage,
                                        TaskRunnerName,
                                        myUnityController.GetPresentableUnityVersion());
            var needStart = MessageBox.ShowYesNo(message, PluginName);

            if (!needStart)
            {
                throw new Exception(string.Format(NotAvailableUnityEditorMessage, TaskRunnerName));
            }

            var commandLines = myUnityController.GetUnityCommandline();
            var unityPath    = commandLines.First();
            var unityArgs    = string.Join(" ", commandLines.Skip(1));
            var process      = new Process
            {
                StartInfo = new ProcessStartInfo(unityPath, unityArgs)
            };

            process.Start();

            return(myUnityController.WaitConnectedUnityProcessId(lifetime));
        }