/// <summary> /// 反初始化 /// </summary> public override void Uninitialize() { if (_updateCheckers != null) { for(int i = 0; i < _updateCheckers.Count; i++) { IFSUpdateChecker.Destory(_updateCheckers[i]); } _updateCheckers.Clear(); _updateCheckers = null; } if (_sessionProcessors != null) { for (int i = 0; i < _sessionProcessors.Count; i++) { IFSSessionProcessor.Destory(_sessionProcessors[i]); } _sessionProcessors.Clear(); _sessionProcessors = null; } if (_localCheckers != null) { for (int i = 0; i < _localCheckers.Count; i++) { IFSLocalChecker.Destory(_localCheckers[i]); } _localCheckers.Clear(); _localCheckers = null; } }
public static void Destory(IFSUpdateChecker cc) { if (cc != null) { cc.UnInit(); cc.gameObject.ExtDestroy(); } }
public static IFSUpdateChecker Create(string sName, string localFileList, string netFileList, IFSUpdateCheckerDelegate handler) { IFSUpdateChecker ret = null; GameObject go = new GameObject("IFSUpdateChecker_" + sName); ret = go.ExtAddComponent <IFSUpdateChecker>(true); ret.Init(sName, localFileList, netFileList, handler); return(ret); }
/// <summary> /// 停止更新检查 /// </summary> /// <param name="sName"></param> public void StopUpdateChecker(string sName) { IFSUpdateChecker cc = null; for (int i = _updateCheckers.Count - 1; i >= 0; --i) { if (_updateCheckers[i].Name.Equals(sName)) { _updateCheckers[i].StopCheck(); return; } } }
/// <summary> /// 检查是否有更新 /// </summary> /// <param name="sName"></param> /// <param name="localFileList"></param> /// <param name="netFileList"></param> /// <param name="handler"></param> public void BeginUpdateChecker(string sName, string localFileList, string netFileListUrl, IFSUpdateCheckerDelegate handler) { for (int i = _updateCheckers.Count - 1; i >= 0; --i) { if (_updateCheckers[i].Name.Equals(sName)) { JW.Common.Log.LogE("Repeat BeginUpdateChecker:" + sName); return; } } IFSUpdateChecker newChecker = IFSUpdateChecker.Create(sName, localFileList, netFileListUrl, handler); if (newChecker != null) { newChecker.gameObject.transform.parent = this.transform; _updateCheckers.Add(newChecker); newChecker.StartCheck(); } }
protected void LateUpdate() { //清理 if (_updateCheckers != null) { for (int i = _updateCheckers.Count - 1; i >= 0; --i) { if (_updateCheckers[i].IsDone) { IFSUpdateChecker.Destory(_updateCheckers[i]); _updateCheckers.RemoveAt(i); } } } // if (_sessionProcessors != null) { for (int i = _sessionProcessors.Count - 1; i >= 0; --i) { if (_sessionProcessors[i].IsDone) { IFSSessionProcessor.Destory(_sessionProcessors[i]); _sessionProcessors.RemoveAt(i); } } } if (_localCheckers != null) { for (int i = _localCheckers.Count - 1; i >= 0; --i) { if (_localCheckers[i].IsDone) { IFSLocalChecker.Destory(_localCheckers[i]); _localCheckers.RemoveAt(i); } } } }