private void SaveSceneToFolder(PopupWindowArgs args, ProjectItem folder) { if (folder.Children != null && folder.Children.Any(p => p.Name.ToLower() == Input.text.ToLower() && p.IsScene)) { PopupWindow.Show("Scene with same name already exits", "Do you want to override it?", "Yes", yes => { RuntimeUndo.Purge(); ShowProgress = true; m_projectManager.SaveScene(folder.Children.Where(p => p.Name.ToLower() == Input.text.ToLower() && p.IsScene).First(), () => { ShowProgress = false; m_parentPopup.Close(false); }); }, "No", no => Input.ActivateInputField()); args.Cancel = true; } else { ProjectItem newScene = ProjectItem.CreateScene(Input.text); folder.AddChild(newScene); RuntimeUndo.Purge(); ShowProgress = true; m_projectManager.SaveScene(newScene, () => { ShowProgress = false; m_parentPopup.Close(false); }); } }