public void onCash(int retcode, float gold, string alipay) { WaittingUIHandler.instance.UnShow(); if (retcode == -1) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setTitle("兑现失败"); box.setContent("兑现后用户余额不能低于" + Users.instance.base_money + "元!!!"); return; } else if (retcode == 0) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setTitle("兑现成功"); box.setContent("兑换金额将转账至\n 支付宝:" + alipay + "\n 请注意查收。\n 如有疑问,请联系客服。"); } Users.instance.Gold = gold; Users.instance.Alipay = alipay; hasGoldLab.text = Users.instance.Gold.ToString(); Debug.Log("onCash retcode = " + retcode); }
public void onEnterHall(int hallID) { WaittingUIHandler.instance.UnShow(); if (hallID == -1) { //hallID = -1 金钱不足 BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setTitle("系统提示"); box.setContent("抱歉,你的剩余金钱不足以进入该场次,请前往充值呢?"); return; } else if (hallID == 0) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setTitle("系统提示"); box.setContent("该账号已开始了对局,否是回到游戏中呢?"); return; } if (gid == 1) { GameSceneManager.instance.loadScene(SceneType.DdzRoom); } else if (gid == 2) { GameSceneManager.instance.loadScene(SceneType.ZjhRoom); } }
//登陆网关失败 public void onLoginBaseappFailed(UInt16 failedcode) { WaittingUIHandler.instance.UnShow(); BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setContent(KBEngineApp.app.serverErr(failedcode)); }
public void onConnectionState(bool status) { if (!status) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setContent("连接失败,请检查网络"); } }
public void onReviseProperties(int retcode, string name, int sexId, int headId) { WaittingUIHandler.instance.UnShow(); if (retcode == 0) { GameSceneManager.instance.loadScene(SceneType.Games); } else { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setContent("昵称只能由中文,英文,数字组合!"); } }
public void onClickLeaveRoom(GameObject obj) { if (DDZRoomUIComponent.state == 1) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(1); box.setTitle("系统提示"); box.setContent("现在退出游戏将会由笨笨哒机器人替你打完这局哦!"); box.setCallback(exitGame); } else { KBEngineApp.app.player().baseCall("reqLeaveRoom"); } }
//注册结果 public void onCreateAccountResult(UInt16 retcode, byte[] datas) { WaittingUIHandler.instance.UnShow(); if (retcode != 0) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setTitle("系统提示"); box.setType(2); box.setContent(KBEngineApp.app.serverErr(retcode)); } else { string buf = System.Text.Encoding.UTF8.GetString(datas); string[] infos = buf.Split('|'); reqAccountLogin(infos[0], infos[1]); } }
public void onClickSure(GameObject obj) { if (amountInput.value.Equals("") || alipayInput.value.Equals("") || amountInput.value.Equals("")) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setTitle("兑现失败"); box.setContent("请填写完整正确信息!!!"); } else { WaittingUIHandler.instance.Show(); this.amount = int.Parse(amountInput.value); KBEngineApp.app.player().baseCall("reqCashInfo", this.amount); } }
public void onCashInfo(int retcode, int gold, int fee) { WaittingUIHandler.instance.UnShow(); if (retcode == -1 || retcode == -2) { BoxUIHandler.instance.Show(); BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(2); box.setTitle("兑现失败"); if (retcode == -2) { box.setContent("兑现金额过低!!!"); } else { box.setContent("兑现后用户余额不能低于" + Users.instance.base_money + "元!!!"); } } else { BoxUIHandler.instance.Show(); string content = "兑现金额:" + gold + "\n" + "实际到账:" + (gold - fee) + "\n" + "支付宝:" + alipayInput.value + "\n" + "手机号:" + Users.instance.Account; this.amount = int.Parse(amountInput.value); this.alipay = alipayInput.value; BoxUIComponent box = BoxUIHandler.instance.getUIComponent(); box.setType(1); box.setTitle("请确认兑换信息"); box.setContent(content); box.setCallback(onClickSend); } }
public override void onInit() { uiComponent = uiObject.GetComponent <BoxUIComponent>(); }
public override void onRelease() { uiComponent = null; }