/// <summary> /// 统一下单接口 /// </summary> /// <param name="payMode">参数</param> /// <returns></returns> public ReturnModels <xml> Unifiedorder(string key, PayMode payMode) { var result = new ReturnModels <xml>(); if (payMode != null) { try { payMode.sign = CommTool.MD5MakeSigne(payMode.ToDictionary(), key); var parmxml = payMode.ToDictionary(); var rdata = HttpSendResult.SendRequest(this.url, parmxml.ToXML(), "POST", "text/xml"); result.RetrnData = rdata.Deserialize <xml>(); } catch (Exception ex) { result.HasError = true; result.Message = ex.Message; } } else { result.HasError = true; result.Message = "支付参数为空对象。"; } return(result); }
private void GetGameStatusData() { gameStatus = CommTool.LoadClass <GameStatus>("GameStatus"); if (gameStatus == null) { gameStatus = new GameStatus(); gameStatus.SetAllPro(GameRunStatus.GameEnd, false, basicTimes); } }
protected override void OnInit() { base.OnInit(); success = CommTool.FindObjForName(gameObject, "Success"); fail = CommTool.FindObjForName(gameObject, "Fail"); failDrop = CommTool.FindObjForName(gameObject, "FailDrop"); gameEnd = CommTool.FindObjForName(gameObject, "GameEnd"); hasboy = CommTool.FindObjForName(gameObject, "HasBoy"); }
protected override void OnInit() { base.OnInit(); time_1 = CommTool.GetCompentCustom <Image>(gameObject, "time_1"); time_2 = CommTool.GetCompentCustom <Image>(gameObject, "time_2"); quxian = CommTool.GetCompentCustom <Image>(gameObject, "quxian"); text_time = CommTool.GetCompentCustom <Text>(gameObject, "time"); this.RegisterMsgEvent( new MsgHandler(EventHandlerType.Success, Success), new MsgHandler(EventHandlerType.HeadPress, HeadPress) ); //elist = SDKManager.Instance.GetVoiceForType(VoiceType.Five); }
protected override void OnInit() { base.OnInit(); modelWheel = CommTool.FindObjForName(gameObject, "wheel_img"); parentWheel = CommTool.FindObjForName(gameObject, "grid"); modelPang = CommTool.FindObjForName(gameObject, "pang"); parentPang = CommTool.FindObjForName(gameObject, "xiaopang"); this.RegisterMsgEvent( new MsgHandler(EventHandlerType.FishHookCheck, FishHookCheck), new MsgHandler(EventHandlerType.UpFinish, UpFinish), new MsgHandler(EventHandlerType.RestStart, RestStart), new MsgHandler(EventHandlerType.GameEnd, GameEnd) ); }
//计算次数 是否达到 private bool ComputeTimes() { int catchCount = CommTool.GetSaveIntData(CatchTimes.Catch.ToString()); //这台机器抓中过的次数 int playrCatch = CommTool.GetSaveIntData(CatchTimes.PlayerCatch.ToString()); //这台机器抓中过的次数 Debug.Log("抓中次数---" + catchCount + "---抓了多少次---" + playrCatch); bool flag = catchCount >= SDKManager.Instance.winningTimes; if (playrCatch >= SDKManager.Instance.carwBasicCount) { CommTool.ClearSaveData(); } return(flag); }
protected override void OnInit() { base.OnInit(); qrCode = CommTool.FindObjForName(gameObject, "QR-code"); raw = CommTool.GetCompentCustom <RawImage>(qrCode, "RawImage"); loading = CommTool.FindObjForName(qrCode, "loading"); fly = CommTool.FindObjForName(qrCode, "fly").transform; yun = CommTool.FindObjForName(qrCode, "yun").transform; vplayer = CommTool.GetCompentCustom <VideoPlayer>(gameObject, "movie"); xiaoP = CommTool.GetCompentCustom <Image>(qrCode, "xiaopang"); animator = CommTool.GetCompentCustom <Animator>(qrCode, "xiaopang"); animator.enabled = false; elist = SDKManager.Instance.GetVoiceForType(VoiceType.QRCode); this.RegisterMsgEvent(new MsgHandler(EventHandlerType.QRCodeSuccess, QRCodeSuccess)); }
private void UpFinish(object[] data) { CommTool.SaveIntData(CatchTimes.PlayerCatch.ToString()); // Stop = true; GameEntity ge = listPang.Find(e => e.catchty != CatchTy.CatchErrorPos);//抓中的 CatchTy tempCatch = ge == null ? CatchTy.CatchErrorPos : ge.catchty; EventHandler.ExcuteMsgEvent(EventHandlerType.Success, tempCatch); if (ge != null && ge.catchty == CatchTy.Catch) { tempPange.SetActive(false); tempPange.transform.SetParent(parentPang.transform); tempPange.transform.localPosition = Vector3.zero; } }
// Use this for initialization void Start() { close.onClick.AddListener(() => obj.SetActive(false)); open.onClick.AddListener(() => obj.SetActive(true)); checkDown.onClick.AddListener(() => { SDKManager.Instance.checkProperty -= 0.2f; }); checkUp.onClick.AddListener(() => { SDKManager.Instance.checkProperty += 0.2f; }); clearSave.onClick.AddListener(() => CommTool.ClearSaveData()); openPay.onClick.AddListener(() => SDKManager.Instance.isOpenPay = !SDKManager.Instance.isOpenPay); }
//获得没使用的子弹 炸弹 private BulletBomEffect GetBullteBom(BullteType bt) { List <BulletBomEffect> tplist; BulletBomEffect zd; if (listZidan.ContainsKey(bt)) { tplist = listZidan[bt]; } else { tplist = new List <BulletBomEffect>(); listZidan.Add(bt, tplist); } zd = tplist.FirstOrDefault(e => !e.isShoot); if (zd == null) { Transform md = null; Vector3 scal = Vector3.zero; if (bt == BullteType.Bullte) { scal = Vector3.one * 1.5f; md = zidan; } else { scal = Vector3.one * 2; md = bom; } GameObject go = CommTool.InstantiateObj(md.gameObject, md.parent.gameObject, Vector3.zero, scal, tplist.Count.ToString()); zd = new BulletBomEffect(go); tplist.Add(zd); listZidan[bt] = tplist; } return(zd); }
protected override void OnInit() { base.OnInit(); msg = CommTool.GetCompentCustom <Text>(gameObject, "msg"); }
private void SaveData() { CommTool.SaveClass <GameStatus>("GameStatus", this); }
IEnumerator WinPlay(CatchTy cat) { SDKManager.Instance.gameStatus.SetGameNumber(time_ci - 1); if (cat == CatchTy.Catch) { MyFuncPerSecond func = null; #region 异物 if (!SDKManager.Instance.isTabke())//出口有异物 { UIManager.Instance.ShowUI(UIPromptPage.NAME, true, CatchTy.HasBoy); List <ExcelTableEntity> etable = SDKManager.Instance.GetVoiceForType(VoiceType.Special); func = (ref float t) => { if (t == 20 && !SDKManager.Instance.isTakeAway) { SDKManager.Instance.Speak(etable[1].TimeContent);//播放音效 } if (t == 0) { t = 21; } return(SDKManager.Instance.isTakeAway); }; yield return(SDKManager.Instance.TimeFun(20, 1, func)); } #endregion #region 胜利等待取走礼物 succNum++; SDKManager.Instance.gameStatus.SetIsCatch(true); SDKManager.Instance.RecordTimes(succNum, true); UIManager.Instance.ShowUI(UIPromptPage.NAME, true, CatchTy.Catch); SDKManager.Instance.AutoSendPresent(); //自动出礼物 CommTool.SaveIntData(CatchTimes.Catch.ToString()); AudioManager.Instance.PlayByName(AudioType.Fixed, AudioNams.shengli, false); //播放胜利音效 SDKManager.Instance.WonDoll(true); //摆动翅膀闪光带 EffectMrg.ShowEffect(); //播放特效 SDKManager.Instance.Speak(elist[0].WinningContent); int winTime = Convert.ToInt32(elist[0].WinTime); int winafter = Convert.ToInt32(elist[0].WinningAfterTime) + 2;//时间间隔两秒 yield return(SDKManager.Instance.TimeFun(winTime, winTime)); func = null; func = (ref float t) => { if (SDKManager.Instance.isTakeAway)//已取走 { Debug.Log("已取走"); EffectMrg.StopPlayEffect(); SDKManager.Instance.WonDoll(false); UIManager.Instance.ShowUI(UIPromptPage.NAME, false); return(true); } if (t == 0) { SDKManager.Instance.Speak(elist[0].WinningAfter);//播放音效 t = winafter; } return(false); }; yield return(SDKManager.Instance.TimeFun(winafter, 1, func)); #endregion } else { SDKManager.Instance.RecordTimes(succNum, false); UIManager.Instance.ShowUI(UIPromptPage.NAME, true, cat);//失败显示 AudioManager.Instance.PlayByName(AudioType.Fixed, AudioNams.shibai, false); string[] contents; if (cat == CatchTy.NoCatch) { contents = elist[0].FailContent.Split('|'); } else { contents = elist[0].FialContentDrop.Split('|'); } int index = UnityEngine.Random.Range(0, contents.Length); SDKManager.Instance.Speak(contents[index]);//随机语音 int delytime = Convert.ToInt32(elist[0].FailTime); if (time_ci > 0) { SDKManager.Instance.Light(false, 5000); } else { SDKManager.Instance.Light(false, (delytime - 1) * 1000); } yield return(new WaitForSeconds(delytime)); UIManager.Instance.ShowUI(UIPromptPage.NAME, false); } RestStart(); }
//创建物体 void CreateGameObject() { GameObject tempObj = null; GameEntity entity = null; if (modelWheel && parentWheel) { Image img; Text duiImg; Text duiImg2; Sprite sp = null; if (modelWheel && parentWheel) { for (int i = 0; i < 14; i++) { float posX = i * 86; if (i == 0) { tempObj = modelWheel; tempObj.SetActive(true); } else { tempObj = CommTool.InstantiateObj(modelWheel, parentWheel, new Vector3(posX, 0, 0), Vector3.one * wheel, "wheels" + i); } tempObj.transform.GetComponent <Image>().overrideSprite = sp; entity = new GameEntity(tempObj); list.Add(entity); } } if (modelPang && parentPang) { tempPange = CommTool.InstantiateObj(modelPang, parentPang, Vector3.zero, Vector3.one * xiaoPang, "tempPange"); img = tempPange.GetComponent <Image>(); duiImg2 = CommTool.GetCompentCustom <Text>(tempPange, "dui"); tempPange.SetActive(false); string img_name = "j-"; string new_name = string.Empty; Vector3 pos = Vector3.zero; for (int i = 0; i < 4; i++) { int num = i + 1; new_name = img_name + num; if (i == 0) { tempObj = modelPang; tempObj.name = new_name; tempObj.SetActive(true); } else { pos.x = i * 380; tempObj = CommTool.InstantiateObj(modelPang, parentPang, pos, Vector3.one * xiaoPang, new_name); } sp = UIAtlasManager.LoadSprite(UIAtlasName.UIMain, new_name); tempObj.transform.GetComponent <Image>().overrideSprite = sp; duiImg = CommTool.GetCompentCustom <Text>(tempObj, "dui"); entity = new GameEntity(tempObj, img, sp, duiImg, duiImg2); listPang.Add(entity); } for (int i = 0; i < 4; i++) { if (i == 0) { listPang[i].last = listPang[3]; } else { listPang[i].last = listPang[i - 1]; } } } } }