Example #1
0
        private bool RegisterServerCallback(Delegate lpCallback, int lpUserData, bool bEnable)
        {
            CallBack   callBack        = null;
            bool       b               = false;
            string     TTProDLL_Method = "TTS_Register" + lpCallback.GetType().ToString().Split('+')[1];
            MethodInfo method          = typeof(TTProDLL).GetMethod(TTProDLL_Method);
            DLL        dg              = (DLL)Delegate.CreateDelegate(typeof(DLL), method);

            foreach (KeyValuePair <CallBack, DLL> cb in Delegate2DLL)
            {
                if (cb.Key.Compare(lpCallback))
                {
                    if (bEnable == true)
                    {
                        return(true);
                    }
                    callBack = cb.Key;
                    b        = Delegate2DLL[callBack](m_ttsInst, callBack.GetFuncPointer(), 0, bEnable);
                    callBack.Dispose();
                    Delegate2DLL.Remove(callBack);
                    callBack = null;
                    return(b);
                }
            }
            if (callBack == null && bEnable)
            {
                callBack = new CallBack(lpCallback);
                Delegate2DLL.Add(callBack, dg);
                b = Delegate2DLL[callBack](m_ttsInst, callBack.GetFuncPointer(), 0, bEnable);
            }
            return(b);
        }
Example #2
0
 private void LoadProgress(string bundleName, float progrecess)
 {
     if (progrecess >= 1.0f)
     {
         CallBack.CallBackRes(bundleName);
         CallBack.Dispose(bundleName);
     }
 }
Example #3
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="bundle"> bundle 相对路径</param>
    /// <param name="progress"></param>
    void LoaderProgrocess(string bundle, float progress)
    {
        if (progress >= 1.0f)
        {
            CallBack.CallBackRes(bundle);

            CallBack.Dispose(bundle);
        }
    }
Example #4
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="bundle"> bundle 相对路径</param>
    /// <param name="progress"></param>
    void LoaderProgrocess(string bundle, float progress)
    {
        //        Debug.Log("Lua  load progresss 22222222222222=="+ progress);

        if (progress >= 1.0f)
        {
            CallBack.CallBackLua(bundle);

            CallBack.Dispose(bundle);
        }
    }