public static string RefreshAB(BuildTarget target)
        {
            var strPlatform = target.ToString();

            s_TargetPlatform = target;
            s_ABDirPath      = string.Format("{0}/{1}/", ABConfig.GetABDirPath(), strPlatform);
            if (!Directory.Exists(s_ABDirPath))
            {
                var error = "can't find dir:" + s_ABDirPath;
                Debug.LogError(error);
                return(error);
            }
            s_TotalABs = 0;
            s_ABInfoDic.Clear();
            s_AssetInfoDic.Clear();
            s_ABTypeStat.Clear();
            s_WaitingInitABs.Clear();
            s_ABDirty = true;

            if (s_ManifestAB != null)
            {
                s_ManifestAB.Unload(true);
                s_ManifestAB = null;
            }
            s_ManifestAB = ABRegister.LoadAssetBundle(s_ABDirPath + strPlatform);
            if (s_ManifestAB != null)
            {
                s_Manifest = s_ManifestAB.LoadAsset <AssetBundleManifest>("AssetBundleManifest");
                s_WaitingInitABs.AddRange(s_Manifest.GetAllAssetBundles());
                s_TotalABs = s_WaitingInitABs.Count;
            }
            return(null);
        }
Esempio n. 2
0
 public override void OnGUI(Rect rect)
 {
     EditorGUI.BeginChangeCheck();
     ABConfig.Instance.AB_DIR = EditorGUILayout.TextField(Styles.abDir, ABConfig.Instance.AB_DIR);
     if (!Directory.Exists(ABConfig.GetABDirPath()))
     {
         EditorGUILayout.HelpBox("Directory not exists:" + ABConfig.GetABDirPath(), MessageType.Warning);
     }
     ABBrowserWindow.Instance.abSource = (ABDatabase.ABSource)EditorGUILayout.EnumPopup(Styles.abSource,
                                                                                        ABBrowserWindow.Instance.abSource);
     if (EditorGUI.EndChangeCheck())
     {
         changed = true;
     }
 }