示例#1
0
 //得到本类的实例
 public static ABLoadAssetHelper GetInstance()
 {
     if (_Instance==null)
     {
         _Instance = new GameObject("_ABLoadAssetHelper").AddComponent<ABLoadAssetHelper>();
     }
     return _Instance;
 }
示例#2
0
 /// <summary>
 /// 调用AB 包资源(通过ABLoadAssetHelper.cs 进行再次封装)
 /// </summary>
 /// <param name="abPara">AB包函数</param>
 /// <param name="taskComplete">回调委托,传出数据</param>
 /// <returns></returns>
 private IEnumerator LoadABAsset(ABPara abPara, DelTaskComplete taskComplete)
 {
     //调用AB框架ab包
     ABLoadAssetHelper.GetInstance().LoadAssetBundlePack(abPara);
     //AB包是否调用完成
     while (!ABLoadAssetHelper.GetInstance().IsLoadFinish)
     {
         yield return(null);
     }
     //得到(克隆)的UI预设
     UnityEngine.GameObject goCloneUIPrefab = (UnityEngine.GameObject)ABLoadAssetHelper.GetInstance().GetCloneUIPrefab();
     //委托调用
     taskComplete.Invoke(goCloneUIPrefab);
 }