Пример #1
0
 private void OnProjectFolderSelectionChanged(object sender, ProjectTreeEventArgs e)
 {
     if (m_projectFolder.SelectedItems == null)
     {
         Editor.Selection.activeObject = null;
     }
     else
     {
         AssetItem[] assetItems = m_projectFolder.SelectedItems.OfType <AssetItem>().Where(o => !m_project.IsScene(o)).ToArray();
         if (assetItems.Length == 0)
         {
             Editor.Selection.activeObject = null;
         }
         else
         {
             Editor.IsBusy = true;
             m_project.Load(assetItems, (error, objects) =>
             {
                 Editor.IsBusy = false;
                 m_projectFolder.HandleEditorSelectionChange = false;
                 Editor.Selection.objects = objects;
                 m_projectFolder.HandleEditorSelectionChange = true;
             });
         }
     }
 }
Пример #2
0
        private void OnProjectFolderItemDoubleClick(object sender, ProjectTreeEventArgs e)
        {
            if (e.ProjectItem == null)
            {
                return;
            }

            if (e.ProjectItem.IsFolder)
            {
                m_projectTree.SelectedItem = e.ProjectItem;
            }
            else
            {
                if (m_project.IsScene(e.ProjectItem))
                {
                    Editor.IsPlaying = false;
                    Editor.IsBusy    = true;
                    m_project.Load(new[] { (AssetItem)e.ProjectItem }, (error, obj) =>
                    {
                        Editor.IsBusy = false;
                        if (error.HasError)
                        {
                            m_windowManager.MessageBox(m_localization.GetString("ID_RTEditor_ProjectView_UnableToLoadScene", "Unable to load scene") + " " + e.ProjectItem.ToString(), error.ToString());
                        }
                    });
                }
            }
        }
Пример #3
0
        private void OnProjectResourcesDoubleClick(object sender, ProjectTreeEventArgs e)
        {
            if (e.ProjectItem == null)
            {
                return;
            }

            if (e.ProjectItem.IsFolder)
            {
                m_projectTree.SelectedFolder = e.ProjectItem;
            }
            else
            {
                if (m_project.IsScene(e.ProjectItem))
                {
                    Editor.IsPlaying = false;
                    Editor.IsBusy    = true;
                    m_project.Load(new[] { (AssetItem)e.ProjectItem }, (error, obj) =>
                    {
                        Editor.IsBusy = false;
                        if (error.HasError)
                        {
                            m_windowManager.MessageBox("Unable to load scene " + e.ProjectItem.ToString(), error.ToString());
                        }
                    });
                }
            }
        }
Пример #4
0
        private void OnProjectTreeItemDeleted(object sender, ProjectTreeEventArgs e)
        {
            if (e.ProjectItem != null)
            {
                ProjectItem[] projectItems = e.ProjectItems;
                projectItems = ProjectItem.GetRootItems(projectItems);
                ProjectItem firstParent = projectItems[0].Parent;

                ShowProgress = true;
                m_projectManager.Delete(projectItems, () =>
                {
                    for (int i = 0; i < projectItems.Length; ++i)
                    {
                        ProjectItem parent = projectItems[i].Parent;
                        if (parent != null)
                        {
                            parent.RemoveChild(projectItems[i]);
                        }
                    }
                    ShowProgress = false;
                    m_projectTree.SelectedFolder = firstParent;
                });
            }
        }
Пример #5
0
        private void OnProjectTreeItemDeleted(object sender, ProjectTreeEventArgs e)
        {
            IRuntimeEditor editor = IOC.Resolve <IRuntimeEditor>();

            editor.DeleteAssets(e.ProjectItems);
        }
Пример #6
0
 private void OnProjectTreeItemDeleted(object sender, ProjectTreeEventArgs e)
 {
     Editor.IsBusy = true;
     m_project.Delete(e.ProjectItems);
 }
Пример #7
0
 private void OnProjectResourcesDoubleClick(object sender, ProjectTreeEventArgs e)
 {
     m_projectTree.SelectedFolder = e.ProjectItem;
 }