Ejemplo n.º 1
0
        public void RemoveBundle(string bundleName)
        {
            AssetBundleBuild_Class item = ContainsBundle(bundleName);

            if (item == null)
            {
                Debug.Log("no Bundle");
            }
            else
            {
                AssetbundleBuilds.Remove(item);
                BuildsToDps();
            }
        }
Ejemplo n.º 2
0
 public void RemoveBundles(string[] bundleName)
 {
     for (int i = 0; i < bundleName.Length; i++)
     {
         AssetBundleBuild_Class item = ContainsBundle(bundleName[i]);
         if (item == null)
         {
             Debug.Log("no Bundle");
         }
         else
         {
             AssetbundleBuilds.Remove(item);
         }
     }
     BuildsToDps();
 }
Ejemplo n.º 3
0
        public void RemoveAssets(string bundleName, string[] AssetName)
        {
            AssetBundleBuild_Class item = ContainsBundle(bundleName);

            if (item == null)
            {
                Debug.Log("no Bundle");
            }
            else
            {
                AssetName.ForEach((assetname) => {
                    for (int i = item.assetNames.Count - 1; i >= 0; i--)
                    {
                        if (item.assetNames[i] == assetname)
                        {
                            item.assetNames.RemoveAt(i);
                        }
                    }
                });
            }
            BuildsToDps();
        }
Ejemplo n.º 4
0
        public void RemoveAsset(string bundleName, string AssetName)
        {
            AssetBundleBuild_Class item = ContainsBundle(bundleName);

            if (item == null)
            {
                Debug.Log("no Bundle");
            }
            else
            {
                for (int i = item.assetNames.Count - 1; i >= 0; i--)
                {
                    if (item.assetNames[i] == AssetName)
                    {
                        item.assetNames.RemoveAt(i);
                    }
                }
            }
            if (item.assetNames.Count == 0)
            {
                AssetbundleBuilds.Remove(item);
            }
            BuildsToDps();
        }
Ejemplo n.º 5
0
            private void ABBWinGUI(Rect rect)
            {
                rect.DrawOutLine(2, Color.black);
                Event e = Event.current;

                ABBListViewCalc.Calc(rect, rect.position, ABBScrollPos, LineHeight, AssetbundleBuilds.Count, ABBSetting);
                this.DrawScrollView(() =>
                {
                    for (int i = ABBListViewCalc.firstVisibleRow; i < ABBListViewCalc.lastVisibleRow + 1; i++)
                    {
                        if (e.modifiers == EventModifiers.Control &&
                            e.button == 0 && e.clickCount == 1 &&
                            ABBListViewCalc.rows[i].position.Contains(e.mousePosition))
                        {
                            ABBListViewCalc.ControlSelectRow(i);
                            _window.Repaint();
                        }
                        else if (e.modifiers == EventModifiers.Shift &&
                                 e.button == 0 && e.clickCount == 1 &&
                                 ABBListViewCalc.rows[i].position.Contains(e.mousePosition))
                        {
                            ABBListViewCalc.ShiftSelectRow(i);
                            _window.Repaint();
                        }
                        else if (e.button == 0 && e.clickCount == 1 &&
                                 ABBListViewCalc.rows[i].position.Contains(e.mousePosition)
                                 /*  && ListView.viewPosition.Contains(Event.current.mousePosition) */)
                        {
                            ABBListViewCalc.SelectRow(i);
                            ChossedABB = AssetbundleBuilds[i];
                            _window.Repaint();
                        }

                        GUIStyle style = i % 2 == 0 ? EntryBackEven : EntryBackodd;
                        if (e.type == EventType.Repaint)
                        {
                            style.Draw(ABBListViewCalc.rows[i].position, false, false, ABBListViewCalc.rows[i].selected, false);
                        }
                        this.Label(ABBListViewCalc.rows[i][ABName].position, AssetbundleBuilds[i].assetBundleName);
                        if (AssetbundleBuilds[i].CrossRefence)
                        {
                            this.Label(ABBListViewCalc.rows[i][RefCount].position, EditorGUIUtility.IconContent("console.warnicon.sml"));
                        }
                        else
                        {
                            this.Label(ABBListViewCalc.rows[i][RefCount].position, EditorGUIUtility.IconContent("Collab"));
                        }
                    }
                }, ABBListViewCalc.view,
                                    ref ABBScrollPos,
                                    ABBListViewCalc.content, false, false);

                if (e.button == 0 && e.clickCount == 1 &&
                    (ABBListViewCalc.view.Contains(e.mousePosition) &&
                     !ABBListViewCalc.content.Contains(e.mousePosition)))
                {
                    ABBListViewCalc.SelectNone();
                    _window.Repaint();
                    ChoosedAsset = null;
                    ChossedABB   = null;
                }

                if (e.button == 1 && e.clickCount == 1 &&
                    ABBListViewCalc.content.Contains(e.mousePosition))
                {
                    GenericMenu menu = new GenericMenu();
                    menu.AddItem(new GUIContent("Delete"), false, () => {
                        ChoosedAsset = null;
                        ChossedABB   = null;
                        ABBListViewCalc.selectedRows.ReverseForEach((row) => {
                            int index = row.rowID;
                            _window.DeleteBundle(AssetbundleBuilds[index].assetBundleName);
                        });


                        _window.UpdateInfo();
                    });

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