void OnGUI()
        {
            using (var horizonal = new EditorGUILayout.HorizontalScope("box")) {
                EditorGUILayout.LabelField ("delete unreference assets from buildsettings and resources");

                if (GUILayout.Button ("Delete", GUILayout.Width (120), GUILayout.Height (40)) && deleteAssets.Count != 0) {
                    RemoveFiles ();
                    Close ();
                }
            }

            using (var scrollScope = new EditorGUILayout.ScrollViewScope(scroll)) {
                scroll = scrollScope.scrollPosition;
                foreach (var asset in deleteAssets) {
                    if (string.IsNullOrEmpty (asset.path)) {
                        continue;
                    }

                    using (var horizonal = new EditorGUILayout.HorizontalScope()) {
                        asset.isDelete = EditorGUILayout.Toggle (asset.isDelete, GUILayout.Width (20));
                        var icon = AssetDatabase.GetCachedIcon (asset.path);
                        GUILayout.Label (icon, GUILayout.Width (20), GUILayout.Height (20));
                        if (GUILayout.Button (asset.path, EditorStyles.largeLabel)) {
                            Selection.activeObject = AssetDatabase.LoadAssetAtPath<Object> (asset.path);
                        }
                    }
                }
            }
        }
Beispiel #2
0
    void OnGUI()
    {
        using (var horizontalScope = new EditorGUILayout.HorizontalScope())
        {
            GUILayout.Box(
                "Drag the right side of the box to change its width.\n Drag the bottom side of the box to change its height.",
                GUILayout.Width(boxWidth), GUILayout.Height(boxHeight));
            boxWidth = EditorGUILayoutExt.VerticalSplitter(2, boxWidth);
        }

        boxHeight = EditorGUILayoutExt.HorizontalSplitter(3, boxHeight);
    }
        void OnGUI()
        {
            using (var horizonal = new EditorGUILayout.HorizontalScope ("box")) {
                GUILayout.Label ("Find Requested Assets");
                if( GUILayout.Button("Refresh", GUILayout.Width(60)) ){
                    assetdataList = PackageImporter.Load();
                }
            }
            if (assetdataList.Any(item => item.pathList.Count != 0) == false) {
                EditorGUILayout.LabelField ("all assets imported");
            }

            foreach( var assetdata in assetdataList ){
                if( assetdata.pathList.Count == 0 ){
                    continue;
                }

                EditorGUILayout.BeginVertical("box");

                using( var horizonal = new EditorGUILayout.HorizontalScope()){

                    if( GUILayout.Button("A$" , GUILayout.Width(30))){
                        if (assetdata.isAssetStore) {
                            UnityEditorInternal.AssetStore.Open (assetdata.asseturl);
                        } else {
                            Application.OpenURL (assetdata.asseturl);
                        }
                    }

                    assetdata.isOpenWindow = GUILayout.Toggle(assetdata.isOpenWindow, assetdata.asseturl, EditorStyles.label);
                }

                if( assetdata.isOpenWindow == true ){
                    EditorGUI.indentLevel = 3;
                    foreach( var file in assetdata.pathList ){
                        EditorGUILayout.LabelField( file);
                    }
                    EditorGUI.indentLevel = 0;
                }
                EditorGUILayout.EndVertical();
            }
        }
        void OnGUI()
        {
            using (var horizonal = new EditorGUILayout.HorizontalScope ("box")) {
                EditorGUILayout.LabelField ("make request asset file");
            }
            using( var horizonal = new EditorGUILayout.HorizontalScope())
            {
                isAssetStore = GUILayout.Toggle (isAssetStore, "IsAssetStore", EditorStyles.miniButton, GUILayout.Width(70));
                GUILayout.Label ("URL", GUILayout.Width(30));
                if (isAssetStore) {
                    GUILayout.Label ("assetstore.unity3d.com/content/", GUILayout.Width (185));
                    assetId = EditorGUILayout.IntField (assetId);
                } else {
                    url = EditorGUILayout.TextField (url);
                }
            }

            using( var horizonal = new EditorGUILayout.HorizontalScope()){
                GUILayout.Label("folderpath:", GUILayout.Width(60));
                GUILayout.Label(path);
                if( GUILayout.Button("Find", GUILayout.Width(40)) ){
                    var fullpath = Path.GetFullPath("Assets");
                    path = EditorUtility.OpenFolderPanel("package manager", "Assets", string.Empty)
                        .Replace(fullpath, "Assets");
                    if( string.IsNullOrEmpty(path) == false){
                        Load(fullpath);
                    }
                }
            }

            EditorGUI.BeginDisabledGroup(
                (isAssetStore && assetId == 0 ) ||
                (isAssetStore == false && url == string.Empty) ||
                assetdataList.Count == 0);
            if( GUILayout.Button("Save")){
                Save();
            }
            EditorGUI.EndDisabledGroup();

            foreach( var assetdata in assetdataList ){
                assetdata.isRequestAssets = EditorGUILayout.ToggleLeft( assetdata.path, assetdata.isRequestAssets);
            }
        }