Пример #1
0
    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);
    }
Пример #2
0
 override public void Dispose()
 {
     fn      = null;
     fnData  = null;
     levelFn = null;
     base.Dispose();
 }
Пример #3
0
    private IEnumerator execWithParam(float t, DelegateEnums.DataParam fn_Data, object data)
    {
        yield return(new WaitForSeconds(t));

        onFinish();
        fn_Data(data);
    }
Пример #4
0
 //带参数的
 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));
 }
Пример #5
0
 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);
 }
Пример #6
0
 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;
 }
Пример #7
0
 /// <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);
     }
 }
Пример #8
0
 internal void OnEnterEffectOver()
 {
     if (fn != null)
     {
         fn();
         fn = null;
     }
     if (fnData != null)
     {
         fnData(this);
         fnData = null;
     }
     LaterInit();
 }
Пример #9
0
 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;
 }
Пример #10
0
    //解析指定路径的二进制文件
    public static void GetDataFromPath <T>(string absolutePath, DelegateEnums.DataParam fn)
    {
        ObjectData2BinSerializer <T> serializer = new ObjectData2BinSerializer <T>();

        serializer.DeserializeFromPath(absolutePath, fn);
    }
Пример #11
0
 public void DeserializeFromPath(string absolutePath, DelegateEnums.DataParam fn)
 {
     this.fn = fn;
     //Log.info("loadBinStart "+absolutePath);
     ResLoaderManager.instance.Loader(new StResPath(absolutePath), onFileLoaded);
 }
Пример #12
0
 //读取本地文件
 public void ReadLocalCache <T>(string key, DelegateEnums.DataParam fn)
 {
     FileTools.GetDataFromPath <T>(SystemConfig.localUserCacheReadPath + "LocalCache/" + key + ".data", fn);
 }
Пример #13
0
 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));
 }
Пример #14
0
 public void clearTmp()
 {
     this.tmp_data    = null;
     this.tmp_fn_None = null;
     this.tmp_fn_Data = null;
 }