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); }
private void LoadProgress(string bundleName, float progrecess) { if (progrecess >= 1.0f) { CallBack.CallBackRes(bundleName); CallBack.Dispose(bundleName); } }
/// <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); } }
/// <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); } }