コード例 #1
0
        /// <summary>
        /// 添加为首包下载文档
        /// </summary>
        public static void FirstLoadFiles(bool delete = false)
        {
            Object[] selection = EditorUtils.SelectObjects();
            string   abName    = "";
            string   apath     = "";

            foreach (Object s in selection)
            {
                abName = GetOriginalAssetBundleName(s, out apath);
                Debug.LogFormat("abname={0}", abName, apath);
                if (string.IsNullOrEmpty(abName))
                {
                    continue;
                }

                if (delete)
                {
                    HugulaExtensionFolderEditor.RemoveExtendsFile(abName);
                }
                else if (!string.IsNullOrEmpty(abName) && !HugulaExtensionFolderEditor.ContainsExtendsPath(apath))
                {
                    HugulaExtensionFolderEditor.AddFirstLoadFile(abName);
                }
                else
                {
                    Debug.LogFormat("assetPath({0}) can't add to extends file list  ", apath);
                }
            }

            HugulaExtensionFolderEditor.SaveSettingData();
        }
コード例 #2
0
ファイル: BuildScript.cs プロジェクト: minedward/hugula
        /// <summary>
        /// 添加为扩展文件
        /// </summary>
        public static void ExtensionFiles(bool delete = false)
        {
            Object[] selection = Selection.objects;
            string   apath     = null;
            string   suffix    = "";
            string   abName    = "";

            foreach (Object s in selection)
            {
                apath = AssetDatabase.GetAssetPath(s);
                AssetImporter
                    import = AssetImporter.GetAtPath(apath);
                if (!string.IsNullOrEmpty(import.assetBundleVariant))
                {
                    suffix = import.assetBundleVariant;
                }
                else
                {
                    suffix = "";
                }

                if (string.IsNullOrEmpty(suffix))
                {
                    abName = import.assetBundleName;
                }
                else
                {
                    abName = import.assetBundleName = "." + suffix;
                }

                if (delete)
                {
                    HugulaExtensionFolderEditor.RemoveExtendsFile(abName);
                }
                else
                {
                    HugulaExtensionFolderEditor.AddExtendsFile(abName);
                }
            }
        }
コード例 #3
0
ファイル: BuildScript.cs プロジェクト: zuojiashun/hugula
        /// <summary>
        /// 添加为扩展文件
        /// </summary>
        public static void ExtensionFiles(bool delete = false)
        {
            Object[] selection = Selection.objects;
            string   abName    = "";
            string   apath     = "";

            foreach (Object s in selection)
            {
                abName = GetOriginalAssetBundleName(s, out apath);
                // Debug.LogFormat("ExtensionFiles name={0},path={1}",abName,apath);
                if (delete)
                {
                    HugulaExtensionFolderEditor.RemoveExtendsFile(abName);
                }
                else if (!HugulaExtensionFolderEditor.ContainsExtendsPath(apath))
                {
                    HugulaExtensionFolderEditor.AddExtendsFile(abName);
                }
                else
                {
                    Debug.LogFormat("assetPath({0}) can't add to extends file list  ", abName);
                }
            }
        }