Exemplo n.º 1
0
 public void RemoveCollectItem(ABDirCollectItem item)
 {
     if (DirCollectItems.Contains(item))
     {
         DirCollectItems.Remove(item);
     }
 }
Exemplo n.º 2
0
 public void AddCollectItem(string path)
 {
     for (int i = 0; i < DirCollectItems.Count; i++)
     {
         if (path.Contains(DirCollectItems[i].SearchPath))
             return;
     }
     ABDirCollectItem collect = new ABDirCollectItem(path);
     DirCollectItems.Add(collect);
 }
Exemplo n.º 3
0
            private void ListView(Event e)
            {
                tableViewCalc.Calc(position, new Vector2(position.x, position.y + lineHeight), ScrollPos, lineHeight, DirCollect.DirCollectItems.Count, Setting);
                if (Event.current.type == EventType.Repaint)
                {
                    GUIStyles.Get(EntryBackodd).Draw(tableViewCalc.position, false, false, false, false);
                }

                bool tog = true;

                this.Toggle(tableViewCalc.titleRow.position, ref tog, GUIStyles.Get(TitleStyle))
                .LabelField(tableViewCalc.titleRow[CollectType].position, CollectType)
                .LabelField(tableViewCalc.titleRow[BundleName].position, BundleName)
                .LabelField(tableViewCalc.titleRow[SearchPath].position, SearchPath);
                this.DrawScrollView(() =>
                {
                    for (int i = tableViewCalc.firstVisibleRow; i < tableViewCalc.lastVisibleRow + 1; i++)
                    {
                        GUIStyle style = i % 2 == 0 ? EntryBackEven : EntryBackodd;
                        if (e.type == EventType.Repaint)
                        {
                            style.Draw(tableViewCalc.rows[i].position, false, false, tableViewCalc.rows[i].selected, false);
                        }
                        if (e.modifiers == EventModifiers.Control &&
                            e.button == 0 && e.clickCount == 1 &&
                            tableViewCalc.rows[i].position.Contains(e.mousePosition))
                        {
                            tableViewCalc.ControlSelectRow(i);
                            window.Repaint();
                        }
                        else if (e.modifiers == EventModifiers.Shift &&
                                 e.button == 0 && e.clickCount == 1 &&
                                 tableViewCalc.rows[i].position.Contains(e.mousePosition))
                        {
                            tableViewCalc.ShiftSelectRow(i);
                            window.Repaint();
                        }
                        else if (e.button == 0 && e.clickCount == 1 &&
                                 tableViewCalc.rows[i].position.Contains(e.mousePosition))
                        {
                            tableViewCalc.SelectRow(i);
                            window.Repaint();
                        }

                        ABDirCollectItem item = DirCollect.DirCollectItems[i];

                        int index = (int)item.CollectType;
                        this.Popup(tableViewCalc.rows[i][CollectType].position,
                                   ref index,
                                   Enum.GetNames(typeof(ABDirCollectItem.ABDirCollectType)));
                        item.CollectType = (ABDirCollectItem.ABDirCollectType)index;
                        this.Button(() =>
                        {
                            chosseWindow.assetinfo = item.subAsset;
                            PopupWindow.Show(tableViewCalc.rows[i][SelectButton].position, chosseWindow);
                        }
                                    , tableViewCalc.rows[i][SelectButton].position, SelectButton);

                        this.Label(tableViewCalc.rows[i][SearchPath].position, item.SearchPath);
                        if (item.CollectType == ABDirCollectItem.ABDirCollectType.ABName)
                        {
                            this.TextField(tableViewCalc.rows[i][BundleName].position, ref item.BundleName);
                        }
                    }
                }, tableViewCalc.view, ref ScrollPos, tableViewCalc.content, false, false);

                Handles.color = Color.black;
                for (int i = 0; i < tableViewCalc.titleRow.columns.Count; i++)
                {
                    var item = tableViewCalc.titleRow.columns[i];

                    if (i != 0)
                    {
                        Handles.DrawAAPolyLine(1, new Vector3(item.position.x - 2,
                                                              item.position.y,
                                                              0),
                                               new Vector3(item.position.x - 2,
                                                           item.position.yMax - 2,
                                                           0));
                    }
                }
                tableViewCalc.position.DrawOutLine(2, Color.black);
                Handles.color = Color.white;
            }