示例#1
0
 static void Import()
 {
     if (window == null)
     {
         window = PackageImporter.GetWindow <PackageImporter>();
     }
     window.assetdataList = PackageImporter.Load();
     window.ShowPopup();
     window.Focus();
 }
示例#2
0
        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();
            }
        }
示例#3
0
        public static void Init()
        {
            if (File.Exists(onceCheckPath) == false)
            {
                var assetdataList = PackageImporter.Load();
                if (assetdataList.Any(item => item.pathList.Count != 0))
                {
                    window = PackageImporter.GetWindow <PackageImporter>();
                    window.assetdataList = assetdataList;
                    Import();
                }
                File.Create(onceCheckPath);
            }

            EditorApplication.delayCall -= Init;
        }
示例#4
0
 void OnFocus()
 {
     assetdataList = PackageImporter.Load();
 }