示例#1
0
 public virtual void Unload()
 {
     if (GGameDataLoader.GetInstance().isInProcesser(this))
     {
         return;
     }
     UnloadImpl();
 }
 public void Unload()
 {
     foreach (GAbstractData data in _unloadDataList)
     {
         if (!GGameDataLoader.GetInstance().isInProcesser(data))
         {
             data.Unload();
         }
     }
     _unloadDataList.Clear();
 }
示例#3
0
 public static GGameDataLoader GetInstance()
 {
     if (_instance == null)
     {
         lock ( _lockHelper )
         {
             if (_instance == null)
             {
                 _instance = new GGameDataLoader();
             }
         }
     }
     return(_instance);
 }
        public void FrameUpdate(float deltaTime)
        {
            for (int i = 0; i < _loadingResList.Count;)
            {
                GAbstractData tempData = _loadingResList[i];

                if (tempData.Update(deltaTime))
                {
                    _loadingResList.RemoveAt(i);
                    DataCompletedHandler(tempData);
                }
                else
                {
                    ++i;
                }

                // don't need progress for now
                //dataProgressHandler( tempData );
            }

            GGameDataLoader.GetInstance().FrameUpdate(deltaTime);
        }
示例#5
0
        public virtual void Init(string path, bool isLocal, System.Object param)
        {
            this._resName = Path.GetFileNameWithoutExtension(path);
            this._param   = param;

            if (isLocalResource == true)
            {
                _filePath = path;
            }
            else
            {
                _filePath = CommonUtil.getWWWURLFromTypeAndName(path);
            }

            if (!AlreadyDownloaded())
            {
                _data           = null;
                _assetLoadError = false;

                GGameDataLoader.GetInstance().StartDownload(this);
            }
        }
示例#6
0
 protected virtual void UnloadImpl()
 {
     if (GetRefCount() <= 0)
     {
         if (readyToUse)
         {
             GameResourceLoadManager.GetInstance().ReleaseGameData(_resName);
         }
         else
         {
             if (GGameDataLoader.GetInstance().removeItem(this))
             {
                 GameResourceLoadManager.GetInstance().ReleaseGameData(ResName);
             }
             else
             {
                 if (error)
                 {
                     //NO CHINESE!
                     //出错的话,删掉
                     GameResourceLoadManager.GetInstance().ReleaseGameData(ResName);
                 }
                 else
                 {
                     if (GGameDataLoader.GetInstance().isInProcesser(this))
                     {
                         //NO CHINESE!
                         //TODO:正在加载中,会不会有问题
                     }
                     else
                     {
                         GameResourceLoadManager.GetInstance().ReleaseGameData(ResName);
                     }
                 }
             }
         }
     }
 }
 public void Terminate(System.Object param = null)
 {
     GGameDataLoader.GetInstance().Terminate();
     Unload();
 }
 public void Startup(AssetBundleManager abManager)
 {
     GGameDataLoader.GetInstance().Startup();
     resourceList   = DataManager.GetInstance().resourcesProtoData;
     this.abManager = abManager;
 }