private void LoadHomeScene(bool server) { MultiTask tasks = new MultiTask(); if (server == false) { tasks.AddTask(new JoinGameTask(m_JoinIPText.text)); } tasks.AddTask(new AsyncLoadScene("HomeScene")); tasks.AddTask(new DestroyObjectsOnComplete(m_DestroyOnLoad)); NetworkManager.Instance().AddTask(tasks); }
private void wizardControl1_FinishClick(object sender, CancelEventArgs e) { DataTable tTasks = GridCheckSetting.DataSource as DataTable; if (tTasks.Rows.Count > 0) { this.Hide(); MultiTask multiTask = new MultiTask(); for (int i = 0; i < tTasks.Rows.Count; i++) { multiTask.AddTask(this.GetTaskFromDataRow(tTasks.Rows[i])); } //FrmMultiTaskCheck frmCheck = new FrmMultiTaskCheck(multiTask); //frmCheck.ExcuteMultiTask(ref m_AvailableTasks); multiTask.CreatingTaskChanged += new TaskCreateEventsHandler(multiTask_CreatingTaskChanged); multiTask.TaskCreated += new TaskCreateEventsHandler(multiTask_TaskCreated); multiTask.CheckingTaskChanged += new TaskCheckEventsHandler(multiTask_CheckingTaskChanged); multiTask.TaskChecked += new TaskCheckEventsHandler(multiTask_TaskChecked); //m_FrmCheck.AdaptCheckerEvents(multiTask.TaskChecker); //System.Threading.ThreadStart threadStart = delegate //{ bool isSucceed = multiTask.Excute(ref m_AvailableTasks); if (isSucceed) { XtraMessageBox.Show(multiTask.PromptMessage); } else { XtraMessageBox.Show("批量任务过程中出现错误,创建失败"); } //}; //System.Threading.Thread thread = new System.Threading.Thread(threadStart); //thread.Start(); } }