public void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath()); byte[] textAsset = (res as DataResItem).getBytes(); if (textAsset != null) { loadFormText(System.Text.Encoding.UTF8.GetString(textAsset), m_path2PakDic); } // 卸载 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); if (m_pakCfgLoadDisp != null) { m_pakCfgLoadDisp(); } } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, res.GetPath()); // 卸载 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); if (m_pakCfgLoadDisp != null) { m_pakCfgLoadDisp(); } } }
/// <summary> /// Creates a session service based on the provided settings /// </summary> /// <param name="settings"></param> public SessionService(Settings settings) { try { _pvx = new DispatchObject("ProvideX.Script"); _pvx.InvokeMethod("Init", settings.HomePath); _oSS = new DispatchObject(_pvx.InvokeMethod("NewObject", "SY_Session")); } catch (Exception e) { Logger.Error(e, e.Message); throw; } try { _oSS.InvokeMethod("nSetUser", settings.Username, settings.Password); _oSS.InvokeMethod("nSetCompany", settings.CompanyCode); } catch (Exception e) { Logger.Error(e, e.Message); Logger.Error(e, GetError()); throw; } }
public void onSkelAnimLoadedHandle(IDispatchObject dispObj) { SkeletonAnim res = dispObj as SkeletonAnim; m_skinModel.setSkelAnim(res.selfGo); m_animControl.animator = res.selfGo.GetComponent<Animator>(); m_boneSockets.setSkelAnim(res.selfGo); }
protected void onBtnClkTuJian(IDispatchObject dispObj) { Ctx.m_instance.m_uiMgr.loadAndShow(UIFormID.eUITuJian); IUITuJian uiSC = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian; uiSC.showUI(); }
protected void onBtnTask3Clk(IDispatchObject dispObj) { m_btnArr[(int)TaskBtnNum.eBtnTaskDes3].selfGo.SetActive(true); m_btnArr[(int)TaskBtnNum.eBtnTask1].selfGo.SetActive(false); m_btnArr[(int)TaskBtnNum.eBtnTask2].selfGo.SetActive(false); m_btnArr[(int)TaskBtnNum.eBtnTask3].selfGo.SetActive(false); }
// 加载一个表完成 public void onLoadEventHandle(IDispatchObject dispObj) { m_res = dispObj as ResItem; if (m_res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, m_res.GetPath()); byte[] bytes = m_res.getBytes(""); if (bytes != null) { m_byteArray = Ctx.m_instance.m_factoryBuild.buildByteBuffer(); m_byteArray.clear(); m_byteArray.writeBytes(bytes, 0, (uint)bytes.Length); m_byteArray.setPos(0); readTable(getTableIDByPath(m_res.GetPath()), m_byteArray); } } else if (m_res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, m_res.GetPath()); } // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath(), onLoadEventHandle); }
public void handleMultiTouchStationary(IDispatchObject touch) { if (null != this.mOnMultiTouchStationaryDispatch) { this.mOnMultiTouchStationaryDispatch.dispatchEvent(touch); } }
// 输入按下移动到卡牌出 override public void onDragOut(IDispatchObject dispObj) { if (!m_card.m_sceneDZData.m_gameRunState.isInState(GameRunState.INITCARD)) { m_card.trackAniControl.normalState(); } }
// 加载一个表完成 public void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath()); string text = res.getText(""); if (text != null) { string[] lineSplitStr = { "\r\n" }; string[] tabSplitStr = { "\t" }; string[] lineList = text.Split(lineSplitStr, StringSplitOptions.RemoveEmptyEntries); int lineIdx = 0; string[] tabList = null; m_filterArr = new string[lineList.Length]; while (lineIdx < lineList.Length) { tabList = lineList[lineIdx].Split(tabSplitStr, StringSplitOptions.RemoveEmptyEntries); m_filterArr[lineIdx] = tabList[1]; ++lineIdx; } } } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, res.GetPath()); } // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); }
public void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath()); if (m_path2SoundDic.ContainsKey(res.GetPath())) // 如果有,说明还没被停止 { if (m_path2SoundDic[res.GetPath()].m_soundResType == SoundResType.eSRT_Prefab) { m_path2SoundDic[res.GetPath()].setResObj(res.InstantiateObject(res.GetPath())); } else { m_path2SoundDic[res.GetPath()].setResObj(res.getObject(res.GetPath())); } } // 播放音乐 play(res.GetPath()); } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath()); delSoundItem(m_path2SoundDic[res.GetPath()]); } // 卸载数据 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); }
/// <summary> /// Gets a record from the table the business object is connected to /// </summary> /// <param name="columnsObject"></param> /// <param name="busObject"></param> /// <param name="session"></param> /// <returns></returns> private static Dictionary <string, dynamic> GetRecord(IDispatchObject busObject, ISessionService session, string[] columnsObject) { // init output record var outDic = new Dictionary <string, dynamic>(); // get information from header table try { // get single record var data = new object[] { "", "" }; busObject.InvokeMethodByRef("nGetRecord", data); var salesOrderObject = data[0].ToString().Split(System.Convert.ToChar(352)); for (var i = 0; i < columnsObject.Length; i++) { outDic[columnsObject[i]] = salesOrderObject[i]; } } catch (Exception e) { Logger.Error(e, e.Message); Logger.Error(e, session.GetError()); throw; } return(outDic); }
// 除了 Enemy 手牌外,所有的卡牌都可以点击,包括主角、装备、技能、手里卡牌、出的卡牌 override public void onCardClick(IDispatchObject dispObj) { // 只有可以出的卡才会作为初始牌 if (m_card.m_sceneDZData.m_gameRunState.isInState(GameRunState.INITCARD)) // 如果处于初始化卡牌阶段 { // 这个时候还没有服务器的数据 m_sceneCardItem int idx = 0; idx = m_card.m_sceneDZData.m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerSelf].inSceneCardList.findCardIdx(m_card); // 显示换牌标志 if (m_card.m_sceneDZData.m_changeCardIdxList.IndexOf(idx) != -1) // 如果已经选中 { m_card.m_sceneDZData.m_changeCardIdxList.Remove(idx); // 去掉叉号 m_card.destroyChaHaoModel(); // 释放资源 } else // 选中 { m_card.m_sceneDZData.m_changeCardIdxList.Add(idx); // 添加叉号 m_card.loadChaHaoModel(m_card.gameObject()); } } else // 如果在对战阶段 { base.onCardClick(dispObj); } }
protected void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.log(string.Format("更新下载文件成功 {0}", (dispObj as DataResItem).path)); m_loadedPath.Add((dispObj as DataResItem).path); m_loadingPath.Remove((dispObj as DataResItem).path); if (m_loadingPath.Count == 0) { onUpdateEnd(); } } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.log(string.Format("更新下载文件失败 {0}", (dispObj as DataResItem).path)); m_failedPath.Add((dispObj as DataResItem).path); m_loadingPath.Remove((dispObj as DataResItem).path); if (m_loadingPath.Count == 0) { onUpdateEnd(); } } }
override public void onOneCardEnterHandleEntry(IDispatchObject card_) { SceneCardBase _card = card_ as SceneCardBase; _card.trackAniControl.createAndAddGridElem(); base.onOneCardEnterHandleEntry(card_); }
virtual public void dispatchEvent(IDispatchObject dispatchObject) { //try //{ incDepth(); foreach (var handle in m_handleList.list) { if (!handle.m_bClientDispose) { handle.m_handle(dispatchObject); } } if (m_luaCSBridgeDispatch != null) { m_luaCSBridgeDispatch.handleGlobalEvent(m_eventId, dispatchObject); } decDepth(); //} //catch (Exception ex) //{ // Ctx.m_instance.m_logSys.catchLog(ex.ToString()); //} }
// 加载一个表完成 protected void onMiniLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { byte[] textAsset = (res as DataResItem).getBytes(); if (textAsset != null) { // Lzma 解压缩 //byte[] outBytes = null; //uint outLen = 0; //MLzma.DecompressStrLZMA(textAsset, (uint)textAsset.Length, ref outBytes, ref outLen); loadFormText(System.Text.Encoding.UTF8.GetString(textAsset), m_miniPath2HashDic); } // 卸载 Ctx.m_instance.m_resLoadMgr.unload(MINIFILENAME, onMiniLoadEventHandle); m_miniLoadedDisp(); } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { // 卸载 Ctx.m_instance.m_resLoadMgr.unload(MINIFILENAME, onMiniLoadEventHandle); m_miniFailedDisp(); } }
public void handleMultiTouchBegan(IDispatchObject touch) { if (null != this.mOnMultiTouchBeganDispatch) { this.mOnMultiTouchBeganDispatch.dispatchEvent(touch); } }
protected void onSceneCfgLoadded(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; m_sceneParse.sceneCfg = m_scene.sceneCfg; string text = res.getText(m_scene.file); m_sceneParse.parse(text); }
// 一个战斗回合结束 public void onOneRoundEnd(IDispatchObject dispObj) { Ctx.m_instance.m_logSys.fightLog("[Fight] 结束一场战斗回合,将要开始下一场战斗回合攻击"); m_curFightData = null; nextOneAttactRound(); }
public string m_path; // 目录 public virtual void onLoadEventHandle(IDispatchObject dispObj) { ModelRes res = dispObj as ModelRes; m_go = res.InstantiateObject(m_path); m_go.transform.parent = m_parentTran; UtilApi.normalPos(m_go.transform); }
protected void onDelBtnClk(IDispatchObject dispObj) { InfoBoxParam param = Ctx.m_instance.m_poolSys.newObject<InfoBoxParam>(); param.m_btnClkDisp = delRet; param.m_midDesc = Ctx.m_instance.m_langMgr.getText(LangTypeId.eTuJian6, LangItemID.eItem0); UIInfo.showMsg(param); }
public void handleMultiTouchCanceled(IDispatchObject touch) { if (null != this.mOnMultiTouchCanceledDispatch) { this.mOnMultiTouchCanceledDispatch.dispatchEvent(touch); } }
public virtual void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; string path = res.GetPath(); if (m_path2ResDic.ContainsKey(path)) { m_path2ResDic[path].refCountResLoadResultNotify.resLoadState.copyFrom(res.refCountResLoadResultNotify.resLoadState); if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { m_path2ResDic[path].init(res); if (m_path2ResDic[path].bOrigResNeedImmeUnload) { // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(path, onLoadEventHandle); } } else { m_path2ResDic[path].failed(res); Ctx.m_instance.m_resLoadMgr.unload(path, onLoadEventHandle); } } else { Ctx.m_instance.m_logSys.log(string.Format("路径不能查找到 {0}", path)); Ctx.m_instance.m_resLoadMgr.unload(path, onLoadEventHandle); } }
protected void onEditBtnClk(IDispatchObject dispObj) { IUITuJian tujian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian; tujian.editCurCardSet(); m_tuJianTopData.m_form.exit(); }
// 元素改变 protected void onElemChangedHandle(IDispatchObject dispObj) { if (!m_bNeedUpdate) { m_bNeedUpdate = true; startNextFrameTimer(); } }
protected void onDelBtnClk(IDispatchObject dispObj) { InfoBoxParam param = Ctx.m_instance.m_poolSys.newObject <InfoBoxParam>(); param.m_btnClkDisp = delRet; param.m_midDesc = Ctx.m_instance.m_langMgr.getText(LangTypeId.eTuJian6, LangItemID.eItem0); UIInfo.showMsg(param); }
public override void onLoadEventHandle(IDispatchObject dispObj) { base.onLoadEventHandle(dispObj); UtilApi.addHoverHandle(m_selfGo, OnMouseHover); // 加载贴图,换贴图 loadTex(); }
public void onSkelAnimLoadedHandle(IDispatchObject dispObj) { SkeletonAnim res = dispObj as SkeletonAnim; m_skinModel.setSkelAnim(res.selfGo); m_animControl.animator = res.selfGo.GetComponent <Animator>(); m_boneSockets.setSkelAnim(res.selfGo); }
public void onModuleFailed(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, res.GetPath()); Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoginLoadEventHandle); }
public void onOneAttackAndHurtEndHandle(IDispatchObject dispObj) { if (UtilApi.isAddressEqual(dispObj, m_curFightData)) // 死亡是可以并行执行的,但是只保留并行执行的最后一个 Item ,只有最后一个回调才起作用 { m_curFightData = null; nextOneAttact(); } }
protected void onDieEndHandle(IDispatchObject dispObj) { // 删除死亡对象 Ctx.m_instance.m_logSys.fightLog(string.Format("[Fight] 真正删除一个卡牌 {0}", m_card.getDesc())); //m_sceneDZData.m_sceneDZAreaArr[m_side].removeAndDestroyOneCardByItem(m_sceneItem); m_card.dispose(); m_card = null; m_OneAttackAndHurtEndDisp.dispatchEvent(this); }
virtual public void onEffectPlayEnd(IDispatchObject dispObj) { m_playEndEventDispatch.dispatchEvent(this); if (m_bAutoRemove) { this.dispose(); // 释放资源 } }
// 一个动画播放结束 public void onOneAniPlayEnd(IDispatchObject dispObj) { if(bAniEndDispNotNull()) { m_aniEndDisp(this); } stop(); }
protected void onAddBtnClk(IDispatchObject dispObj) { IUITuJian uiTuJian = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUITuJian) as IUITuJian; if (uiTuJian != null) { uiTuJian.addCurCard2CardSet(); } m_tuJianTopData.m_form.exit(); }
protected void onBtnClkShop(IDispatchObject dispObj) { Ctx.m_instance.m_uiMgr.loadAndShow(UIFormID.eUIShop); IUIShop shop = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIShop) as IUIShop; UtilApi.setScale(shop.GUIWin().m_uiRoot.transform, new Vector3(1.0f, 1.0f, 1.0f)); // 发送消息 stReqMarketObjectInfoPropertyUserCmd cmd = new stReqMarketObjectInfoPropertyUserCmd(); UtilMsg.sendMsg(cmd); }
protected void onFirstEffectPlayEndHandle(IDispatchObject dispObj) { UtilApi.addEventHandle(m_model.selfGo, OnBtnClk); m_firstEffect = null; if (m_sndEffect == null) { m_sndEffect = Ctx.m_instance.m_sceneEffectMgr.addLinkEffect(m_sndEffectId, gameObject(), false, true) as LinkEffect; } }
// 点击开包按钮 protected virtual void onBtnClkOpen(IDispatchObject dispObj) { if (!UtilApi.IsPointerOverGameObject()) { // 点击放入中间的格子 if (m_clkCB != null) { m_clkCB(this); } } }
public virtual void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { } }
protected void onPakResLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { initByPakRes(); } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { refCountResLoadResultNotify.loadResEventDispatch.dispatchEvent(this); } }
public void dispatchEvent(int groupID, IDispatchObject dispatchObject) { m_bInLoop = true; if (m_groupID2DispatchDic.ContainsKey(groupID)) { m_groupID2DispatchDic[groupID].dispatchEvent(dispatchObject); } else { Ctx.m_instance.m_logSys.log("Event Dispatch Group not exist"); } m_bInLoop = false; }
protected void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { res.InstantiateObject("Anim/boxcampush"); } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { } Ctx.m_instance.m_resLoadMgr.unload("Anim/boxcampush", onLoadEventHandle); }
public void onLoaded(IDispatchObject dispObj) { SkelAnimRes res = dispObj as SkelAnimRes; Ctx.m_instance.m_logSys.logLoad(res); if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { this.selfGo = res.InstantiateObject(res.GetPath()); m_skelLoadDisp.dispatchEvent(this); } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_skelAniMgr.unload(res.GetPath(), onLoaded); m_skelAnim = null; } }
override protected void updateBtnCom(IDispatchObject dispObj) { bool bGoChange = false; if (m_selfGo != m_auxDynTexDynGOImage.selfGo) { m_selfGo = m_auxDynTexDynGOImage.selfGo; bGoChange = true; } if (m_pntGo == m_auxDynTexDynGOImage.pntGo) { m_pntGo = m_auxDynTexDynGOImage.pntGo; bGoChange = true; } if (bGoChange) { base.updateBtnCom(dispObj); } }
public virtual void onLoadEventHandle(IDispatchObject dispObj) { m_res = dispObj as ModelRes; if (m_res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, m_res.GetPath()); m_selfGo = m_res.InstantiateObject(m_path); m_selfGo.transform.SetParent(m_selfLocalGo.transform, false); // 不是使用 m_resLoadMgr.load 接口加载的资源,不要使用 m_resLoadMgr.unload 去卸载资源 // 卸载资源 //Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath()); } else if (m_res.refCountResLoadResultNotify.resLoadState.hasFailed()) { m_res = dispObj as ModelRes; Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, m_res.GetPath()); // 卸载资源 //Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath()); } }
// 加载一个表完成 public void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath()); string text = res.getText(""); if (text != null) { string[] lineSplitStr = { "\r\n" }; m_nameList = text.Split(lineSplitStr, StringSplitOptions.RemoveEmptyEntries); } } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, res.GetPath()); } // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); }
public void onExitBtnClk(IDispatchObject dispObj) { m_tuJianTopData.m_form.exit(); }
// 加载一个表完成 public void onLoadEventHandle(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; //Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath()); // 这行执行的时候 m_isLoaded 设置加载标志,但是 m_nodeList 还没有初始化 Ctx.m_instance.m_logSys.log("local xml loaded"); string text = res.getText(m_ID2FileName[m_langID].m_filePath); if (text != null) { SecurityParser SP = new SecurityParser(); SP.LoadXml(text); SecurityElement SE = SP.ToXml(); m_nodeList = SE.Children; } // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); }
public void onFailed(IDispatchObject dispObj) { ResItem res = dispObj as ResItem; Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, res.GetPath()); // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle); }