Exemplo n.º 1
0
 private void AddCollectItem(string path)
 {
     if (string.IsNullOrEmpty(path) || !path.Contains("Assets"))
     {
         return;
     }
     if (!Directory.Exists(path))
     {
         return;
     }
     DirCollect.AddCollectItem(path);
     window.UpdateInfo();
 }
Exemplo n.º 2
0
            private void Eve(Event e)
            {
                if (e.button == 0 && e.clickCount == 1 &&
                    (!tableViewCalc.view.Contains(e.mousePosition) ||
                     (tableViewCalc.view.Contains(e.mousePosition) &&
                      !tableViewCalc.content.Contains(e.mousePosition))))
                {
                    tableViewCalc.SelectNone();
                    window.Repaint();
                }
                DragAndDropIInfo info = DragAndDropUtil.Drag(e, tableViewCalc.view);

                if (info.enterArera && info.compelete)
                {
                    for (int i = 0; i < info.paths.Length; i++)
                    {
                        AddCollectItem(info.paths[i]);
                    }
                }
                if (e.button == 1 && e.clickCount == 1 &&
                    tableViewCalc.content.Contains(e.mousePosition))
                {
                    GenericMenu menu = new GenericMenu();
                    menu.AddItem(new GUIContent("Delete"), false, () => {
                        for (int i = tableViewCalc.rows.Count - 1; i >= 0; i--)
                        {
                            if (tableViewCalc.rows[i].selected)
                            {
                                DirCollect.RemoveCollectItem(DirCollect.DirCollectItems[i]);
                            }
                        }
                        window.UpdateInfo();
                    });

                    menu.ShowAsContext();
                    if (e.type != EventType.Layout)
                    {
                        e.Use();
                    }
                }
            }