Example #1
0
        /// <summary>
        /// 清理扩展文件夹
        /// </summary>
        public static void ClearExtendsFloder()
        {
            Object[] selection = Selection.objects;
            string   apath     = null;

            foreach (Object s in selection)
            {
                if (s is DefaultAsset)
                {
                    apath = AssetDatabase.GetAssetPath(s);
                    AssetImporter import = AssetImporter.GetAtPath(apath);
                    import.userData        = null;
                    import.assetBundleName = null;
                    //import.assetBundleVariant = null;
                    AssetDatabase.SetLabels(s, null);
                    import.SaveAndReimport();
                    //apath = apath.Replace("\\","/");
                    if (HugulaSettingEditor.ContainsExtendsPath(apath))
                    {
                        Debug.LogFormat("{0},Clear AssetLabels,path ={1}", s.name, apath);
                        HugulaSettingEditor.RemoveExtendsPath(apath);
                        AssetDatabase.Refresh();
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// 设置为扩展包路径文件夹
        /// </summary>
        public static void SetAsExtendsFloder()
        {
            Object[] selection = Selection.objects;
            string   apath     = null;

            foreach (Object s in selection)
            {
                if (s is DefaultAsset)
                {
                    apath = AssetDatabase.GetAssetPath(s);
                    AssetImporter import = AssetImporter.GetAtPath(apath);
                    import.assetBundleName = null;
                    //import.assetBundleVariant = null;
                    import.userData = HugulaFolder;
                    AssetDatabase.SetLabels(s, new string[] { HugulaFolder });
                    import.SaveAndReimport();
                    if (!HugulaSettingEditor.ContainsExtendsPath(apath))
                    {
                        Debug.LogFormat("add extends path = {0}", s.name);
                        HugulaSettingEditor.AddExtendsPath(apath);
                    }
                    AssetDatabase.Refresh();
                }
            }
        }
Example #3
0
 static public string GetLabelsByPath(string abPath)
 {
     return(HugulaSettingEditor.GetLabelsByPath(abPath));
 }