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(); }
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); }
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); } }
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; }