public void DrawToolBar(Rect toolbarBound)
        {
            GUI.BeginGroup(toolbarBound, EditorStyles.toolbar);

            var addBunttonRect = new Rect(0f, 0f, 40f, toolbarBound.height);

            if (GUI.Button(addBunttonRect, "Add", EditorStyles.toolbarButton))
            {
                BatchBuildConfig.CreateNewGraphCollection("New Collection");

                m_collectionTree.Reload();
            }

            GUI.EndGroup();
        }
Exemplo n.º 2
0
        private DragAndDropVisualMode HandleDragDropOutsideItems(DragAndDropData data)
        {
            DragAndDropVisualMode visualMode = DragAndDropVisualMode.Copy;

            if (data.args.performDrop)
            {
                var guid      = data.graphGuids [0];
                var graphName = Path.GetFileNameWithoutExtension(AssetDatabase.GUIDToAssetPath(guid));

                var c = BatchBuildConfig.CreateNewGraphCollection(graphName);

                c.AddGraphRange(data.graphGuids);

                m_controller.UpdateSelectedGraphCollection(c);
                m_controller.Refresh();

                BatchBuildConfig.SetConfigDirty();
            }

            return(visualMode);
        }