/// <summary> /// 获得历史记录中动物的图片 /// </summary> /// <param name="spriteIndex"></param> /// <returns></returns> public Sprite SetHistoryAnimal(LSResult res) { string name = ""; switch (res.ResultType) { case LSRewardType.BIG_THREE: switch (res.BetIndex / 3) { case (int)LSAnimalType.TZ: case (int)LSAnimalType.GOLD_TZ: name = "tz_c"; break; case (int)LSAnimalType.HZ: case (int)LSAnimalType.GOLD_HZ: name = "hz_c"; break; case (int)LSAnimalType.XM: case (int)LSAnimalType.GOLD_XM: name = "xm_c"; break; case (int)LSAnimalType.SZ: case (int)LSAnimalType.GOLD_SZ: name = "sz_c"; break; } break; case LSRewardType.BIG_FOUR: switch (res.BetIndex % 3) { case (int)LSColorType.RED: name = "all_r"; break; case (int)LSColorType.GREEN: name = "all_g"; break; case (int)LSColorType.YELLOW: name = "all_y"; break; } break; case LSRewardType.LIGHTING: case LSRewardType.HANDSEL: case LSRewardType.NORMAL: name = ((LSAnimalSpriteType)res.BetIndex).ToString(); break; case LSRewardType.SENDLAMP: name = "point"; break; } return(App.GetGameManager <LswcGamemanager>().ResourseManager.GetSprite(name)); }
/// <summary> /// 新增一条历史记录 /// </summary> /// <param name="res"></param> private void AddHistory(LSResult res) { HistoryResults[History_Index] = res; History_Index++; if (History_Index == LSConstant.History_Lenth) { History_Index = 0; } }
/// <summary> /// 解析一条历史数据 /// </summary> /// <param name="result">服务器返回的历史数据</param> /// <returns></returns> private LSResult AnalysisResult(int result) { //Debug.LogError("历史结果是:" + result); int animalIndex = result & 0xf; result = result >> 4; int rewardType = result & 0xf; result = result >> 4; int banker = result & 0xf; //Debug.LogError("解析出来的结果是(从左到右):" + (LSBankerType)banker + " " + (LSRewardType)rewardType + " " + (LSAnimalSpriteType)animalIndex); LSResult res = new LSResult(animalIndex, rewardType, banker); return(res); }
/// <summary> /// 获得最新的历史记录的详细信息 /// </summary> /// <returns></returns> public LS_Detail_Result SetDetialResult(int TurnTablePosition, float Time, int multiple, int addGold) { //Debug.LogError("本局结果是"); LSResult res = GetHistoryResult(LSConstant.History_Lenth - 1); LSColorType resultColor = Colors[TurnTablePosition]; LSAnimalType resultAnimal = (LSAnimalType)AnimalStartPos[TurnTablePosition]; LastResult.Banker = res.Banker; LastResult.TurnTablePosition = TurnTablePosition; LastResult.BetIndex = res.BetIndex; LastResult.Reward = res.ResultType; //LastResult.Reward = LSRewardType.LIGHTING; LastResult.Cor = (LSColorType)(res.BetIndex % 3); LastResult.Ani = (LSAnimalType)(res.BetIndex / 3); YxDebug.Log("通过历史数据解析的结果为:动物 " + LastResult.Ani + " 颜色是:" + LastResult.Cor); LastResult.Cor = resultColor; LastResult.Ani = resultAnimal; LastResult.Multiple = multiple; //LastResult.Multiple = 3; _totalGold += addGold; LastResult.WinBets = addGold; YxDebug.Log("结果类型:" + LastResult.Reward); YxDebug.Log("指针:" + LastResult.TurnTablePosition); YxDebug.Log("动物:" + LastResult.Ani); YxDebug.Log("颜色: " + LastResult.Cor); YxDebug.Log("庄和闲: " + LastResult.Banker); YxDebug.Log("增加金币" + addGold); var gameMgr = App.GetGameManager <LswcGamemanager>(); LastResult.ToColor = gameMgr.ColorItemControl.GetCheckColorItem(LastResult.TurnTablePosition) as LSColorItem; if (LastResult.ToColor != null) { LastResult.ToAngle = LastResult.ToColor.transform.localEulerAngles; } LastResult.ToAnimal = gameMgr.AnimalItemCtrl.GetCheckColorItem((LastResult.TurnTablePosition - AnimalRandomSeed + LSConstant.Num_AnimalItemNumber) % 24) as LSAnimalItem; LastResult.lastResultVoice = GetResultVoice(); return(LastResult); }