public string addDelay(float t, DelegateEnums.DataParam fn_Data, object data, string ID = "") { if (ID == "") { autoID++; ID = autoID.ToString(); } else { if (dict.ContainsKey(ID)) { stopDelay(ID); } } // DelayCaller caller = getCaller(); caller.ID = ID; caller.addDelay(t, fn_Data, data); dict.Add(ID, caller); updateTitle(); return(ID); }
override public void Dispose() { fn = null; fnData = null; levelFn = null; base.Dispose(); }
private IEnumerator execWithParam(float t, DelegateEnums.DataParam fn_Data, object data) { yield return(new WaitForSeconds(t)); onFinish(); fn_Data(data); }
//带参数的 public void addDelay(float t, DelegateEnums.DataParam fn_Data, object data) { this.time = t; this.tmp_fn_Data = fn_Data; this.tmp_data = data; StartCoroutine(execWithParam(t, fn_Data, data)); }
public void StartLoad(DelegateEnums.DataParam callback) { _callback = callback; if (IsLoaded && _callback != null) { _callback(ModuleName); } IsLoading = true; ResLoaderManager.instance.Loader(_resList, ModuleName + "_list", OnResLoaded, null, OnResLoadError, OnResLoadListProgress); }
public void UnLoad(bool unLoadUseObj = false) { for (int i = 0; i < _resList.Count; i++) { StResPath resPath = _resList[i]; ResDataManager.instance.RemoveAssetBundle(resPath.path, true, unLoadUseObj); } _resList.Clear(); _resList = null; _callback = null; }
/// <summary> /// 执行入场效果 /// </summary> /// <param name="fn"></param> public void ExecEnterEffect(DelegateEnums.DataParam fn) { this.fnData = fn; if (effectTime_Enter > 0) { EnterEffect(); ToolKit.coroutineDelay(effectTime_Enter, OnEnterEffectOver); } else { this.fnData(this); } }
internal void OnEnterEffectOver() { if (fn != null) { fn(); fn = null; } if (fnData != null) { fnData(this); fnData = null; } LaterInit(); }
private void onFileLoaded(string path, object param = null) { Byte[] bytes = ResDataManager.instance.GetDataBytes(path); if (bytes == null) { fn(null); } else { T data = DeserializeBinary(bytes); fn(data); ResDataManager.instance.RemoveAssetBundle(path); } fn = null; }
//解析指定路径的二进制文件 public static void GetDataFromPath <T>(string absolutePath, DelegateEnums.DataParam fn) { ObjectData2BinSerializer <T> serializer = new ObjectData2BinSerializer <T>(); serializer.DeserializeFromPath(absolutePath, fn); }
public void DeserializeFromPath(string absolutePath, DelegateEnums.DataParam fn) { this.fn = fn; //Log.info("loadBinStart "+absolutePath); ResLoaderManager.instance.Loader(new StResPath(absolutePath), onFileLoaded); }
//读取本地文件 public void ReadLocalCache <T>(string key, DelegateEnums.DataParam fn) { FileTools.GetDataFromPath <T>(SystemConfig.localUserCacheReadPath + "LocalCache/" + key + ".data", fn); }
public static string delayCall(float t, DelegateEnums.DataParam fn, object data, string ID = "") { // return getInstence().tm.addDelay(t, fn, data, ID); return(dm.addDelay(t, fn, data, ID)); }
public void clearTmp() { this.tmp_data = null; this.tmp_fn_None = null; this.tmp_fn_Data = null; }